Proper spraying and wiping of polish objects implemented
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DirtScript : MonoBehaviour
|
||||
{
|
||||
public GameObject Spray;
|
||||
|
||||
private bool sprayed = false;
|
||||
|
||||
void OnCollisionEnter2D(Collision2D other){
|
||||
|
||||
if(other.gameObject.name == "SprayBottle" && !sprayed)
|
||||
{
|
||||
sprayed = true;
|
||||
Instantiate(Spray, new Vector2(this.transform.position.x, this.transform.position.y), Quaternion.identity);
|
||||
}
|
||||
|
||||
if(other.gameObject.name == "Rag" && sprayed)
|
||||
{
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user