Got a very basic polish implementation working

This commit is contained in:
Gregory Campbell
2020-06-01 20:59:48 -04:00
parent a14c816430
commit 82434fa6c2
4 changed files with 302 additions and 177 deletions
+25
View File
@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectScript : MonoBehaviour
{
void OnCollisionEnter2D(Collision2D other){
if(!this.transform.GetChild(1).gameObject.activeInHierarchy &&
other.gameObject.name == "SprayBottle")
{
this.transform.GetChild(1).gameObject.SetActive(true);
}
if(this.transform.GetChild(1).gameObject.activeInHierarchy &&
other.gameObject.name == "Rag")
{
this.transform.GetChild(0).gameObject.SetActive(false);
this.transform.GetChild(1).gameObject.SetActive(false);
}
//Debug.Log("Collision");
}
}