void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("GoalLine")) { // Debug.Log("[Boy.cs] - Passed goal line"); movementDisabled = true; isStopping = true; animator.Play("kick_ani"); gauge.StartHit(); StartCoroutine(KickBall()); } else if (other.gameObject.tag.Equals("Gate")) { Gate gate = other.gameObject.GetComponent <Gate>(); SetColor(gate.GetColor()); Destroy(other.gameObject); } else if (other.gameObject.tag.Equals("Sphere")) { SpherePickup sphere = other.gameObject.GetComponent <SpherePickup>(); InGameColor sphereColor = sphere.GetColor(); if (color == sphereColor) { SpherePickedup(true); } else { SpherePickedup(false); } Destroy(other.transform.parent.gameObject); } }
public void OneColor(InGameColor color) { for (int i = 0; i < 3; i++) { SpherePickup sPickup = ballsRenderer[i].GetComponent <SpherePickup>(); sPickup.color = color; Material material = MaterialCatalog.instance.GetColor(sPickup.color.ToString()); ballsRenderer[i].material = material; } }
public void RandomColor() { Shuffle(colors); for (int i = 0; i < 3; i++) { SpherePickup sPickup = ballsRenderer[i].GetComponent <SpherePickup>(); sPickup.color = colors[i]; ballsRenderer[i].material = MaterialCatalog.instance.GetColor(sPickup.color.ToString()); } }