void Awake() { if (instance == null) { instance = this; } isAlive = true; }
void Awake() { if (instance == null) { instance = this; } isAlive = true; flapButton = GameObject.FindGameObjectWithTag ("FlapButton").GetComponent<Button> (); flapButton.onClick.AddListener (() => FlapTheBird()); SetCamerasX (); }
// function to be executed once the bird is created void Awake() { if (bird == null) bird = this; else if (bird != this) Destroy (gameObject); source = GetComponent<AudioSource>(); // placing the bird transform.position = new Vector2(0f,0f); spriteRenderer = GetComponent<SpriteRenderer>(); if (spriteRenderer.sprite == null){ spriteRenderer.sprite = fly_sprite; } }
public override void PlayerDiedShowScore(BirdScript bird) { var medalIndex = GameController.Instance.EvaluatePlayerScore(score); StageUI.Instance.PlayerDied(score, medalIndex); }