public static CorruptColour GetOppositeCorruptColour(CorruptColour c) { if (c == CorruptColour.Blue) { return(CorruptColour.Red); } else { return(CorruptColour.Blue); } }
public static Color GetCorrespondingColour(CorruptColour c) { if (c == CorruptColour.Blue) { return(Color.blue); } else { return(Color.red); } }
IEnumerator moveExplosionObj(CorruptExplosion data) { GameObject obj = Instantiate(data.prefab, data.sender.transform.position, data.sender.transform.rotation); CorruptColour c = GameHandler.GetRandomCorruptColour(); obj.GetComponent <Corrupt>().corruptColour = c; //Debug.Log(c); float Rnd_R = UnityEngine.Random.Range(0f, 360); obj.transform.Rotate(new Vector3(0f, 0f, Rnd_R)); for (; ;) { yield return(null); if (PlayerUI.singleton.isPaused) { continue; } obj.transform.Translate(obj.transform.up * Time.fixedDeltaTime * data.speed * 0.1f); } }
void OnChangeCorruptColour(object sender, EventArgs e) { playerCorruptColour = GetOppositeCorruptColour(playerCorruptColour); }