public ControllerTrashCan() { classTrashCan = GameObject.Find("Player/Trash Can").GetComponent <ClassTrashCan>(); scriptGame = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <ScriptGame>(); classTrashCan.controllerTrashCan = this; earth = GameObject.Find("Earth"); }
public static void Score(ClassTrashCan dataTrashCan) { dataTrashCan.life += 1 * 5; if (dataTrashCan.life > 100) { dataTrashCan.life = 100; } BehaviourSound.Play("SFX/Point"); }
void OnCollisionEnter2D(Collision2D c) { if (c.gameObject.CompareTag("Earth")) { Destroy(gameObject); } if (c.gameObject.CompareTag("Player")) { ClassTrashCan player = c.gameObject.transform.parent.GetComponent <ClassTrashCan>(); player.controllerTrashCan.Point(); Instantiate(effectDestroy, transform.position, transform.rotation); Destroy(gameObject); } }
public static void Walk(ClassTrashCan dataTrashCan, int direction) { BehaviourPhysics.Turn(dataTrashCan.transform.parent.gameObject, Vector3.forward * direction, dataTrashCan.moveSpeed); //BehaviourAnimation.Play(dataTrashCan.gameObject, "Walk"); //BehaviourSound.Play("Walk"); }
public static void Hurt(ClassTrashCan dataTrashCan) { dataTrashCan.life -= 1 * 5; }
public static void ChangeColor(ClassTrashCan dataTrashCan, string color) { BehaviourAnimation.Play(dataTrashCan.gameObject, "Color_" + color); }
public static void Idle(ClassTrashCan dataTrashCan) { //BehaviourAnimation.Play(dataTrashCan.gameObject, "Idle"); }
public override void TrackObject(GameObject gameObject) { classTrashCan = gameObject.GetComponent <ClassTrashCan>(); scriptGame = gameObject.GetComponent <ScriptGame>(); classTrashCan.controllerTrashCan = this; }
void Start() { trashCan = GameObject.Find("Main/Player/Trash Can").GetComponent <ClassTrashCan>(); Blink(); }