Inheritance: MonoBehaviour
Esempio n. 1
0
    void Awake()
    {
        if (instance == null) {
            instance = this;
        }

        isAlive = true;
    }
Esempio n. 2
0
	void Awake() {
		if (instance == null) {
			instance = this;
		}
		
		isAlive = true;
		
		flapButton = GameObject.FindGameObjectWithTag ("FlapButton").GetComponent<Button> ();
		flapButton.onClick.AddListener (() => FlapTheBird());
		
		SetCamerasX ();
	}
Esempio n. 3
0
    // 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;
        }
    }
Esempio n. 4
0
    public override void PlayerDiedShowScore(BirdScript bird)
    {
        var medalIndex = GameController.Instance.EvaluatePlayerScore(score);

        StageUI.Instance.PlayerDied(score, medalIndex);
    }