2020-06-02 20:11:26 -04:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class SprayScript : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
|
2020-06-03 18:27:09 -04:00
|
|
|
private int wiped = 0;
|
|
|
|
|
Color tmp;
|
|
|
|
|
|
|
|
|
|
void OnCollisionExit2D(Collision2D other){
|
|
|
|
|
|
|
|
|
|
tmp = this.GetComponent<SpriteRenderer>().color;
|
2020-06-02 20:11:26 -04:00
|
|
|
|
|
|
|
|
if(other.gameObject.name == "Rag")
|
|
|
|
|
{
|
2020-06-03 18:27:09 -04:00
|
|
|
|
|
|
|
|
wiped++;
|
|
|
|
|
|
|
|
|
|
tmp.a -= 0.15f;
|
|
|
|
|
this.GetComponent<SpriteRenderer>().color = tmp;
|
|
|
|
|
|
|
|
|
|
if(wiped >= 3) Destroy(this.gameObject);
|
|
|
|
|
|
2020-06-02 20:11:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|