/*IEnumerator BreakTimer() * { * Time.timeScale = 0.0f; * yield return WaitForUnscaledSeconds(5f); * Time.timeScale = 1.0f; * } * * IEnumerator WaitForUnscaledSeconds(float dur) * { * var cur = 0f; * while (cur < dur) * { * yield return null; * cur += Time.unscaledDeltaTime; * } * }*/ // Use this for initialization void Start() { textSpawn = GetComponentInChildren <StamLossTextManager>(); //The idea here is to create a Checkpoint at the location of the player, but it's not working and doesn't need to because //Checkpoint = new Checkpoint(gameObject.transform.position); positionLastFrame = transform.position; for (int i = 0; i < transform.childCount; i++) { // Gets the player's body by name. This is far from optimal sense the name may be different. if (transform.GetChild(i).gameObject.name.Equals("MC Sprite")) { playerBody = transform.GetChild(i).transform.GetChild(1).gameObject; } } }
public void init(StamLossTextManager creator, string Text, Color color) { GetComponentInChildren <Text>().color = color; GetComponentInChildren <Text>().text = Text; destroyer = creator; }