protected void TestHole() { Transform hole = CollisionDetect(Vector3.zero, holeLayer); if (hole) { Hole h = hole.GetComponent <Hole>(); h.typeId = typeId; gameObject.SetActive(false); // DOING SOME REALLY SKETCH STUFF h.FillHole(); h.sketchObj = gameObject; } }
void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.GetComponent <TomatoPlant>() != null || coll.gameObject.GetComponent <TomatoFruit>() != null) { // TomatoPlant tomato_plant = coll.gameObject.GetComponent<TomatoPlant>(); Destroy(coll.gameObject); // thieving_behaviour.LeaveArea(); // LeaveArea(); // is_done = true; } else if (coll.gameObject.GetComponent <Hole>() != null) { Hole hole = coll.gameObject.GetComponent <Hole>(); if (!hole.IsFilled) { hole.FillHole(); audio_controller.MakeCrashSound(); Destroy(gameObject); } } }