Exemplo n.º 1
0
        private Animator anim;                                  // Reference to the Animator on the player


        void Awake()
        {
            // Setting up references.
            playerControl = GetComponent <Platformer2DUserControl>();
            healthBar     = GameObject.Find("HealthBar").GetComponent <SpriteRenderer>();
            anim          = GetComponent <Animator>();

            // Getting the intial scale of the healthbar (whilst the player has full health).
            healthScale = healthBar.transform.localScale;
        }
Exemplo n.º 2
0
        void Awake()
        {
            // Setting up references.
            playerControl = GetComponent<Platformer2DUserControl>();
            healthBar = GameObject.Find("HealthBar").GetComponent<SpriteRenderer>();
            anim = GetComponent<Animator>();

            // Getting the intial scale of the healthbar (whilst the player has full health).
            healthScale = healthBar.transform.localScale;
        }
Exemplo n.º 3
0
        private int previousScore = 0;                          // The score in the previous frame.


        void Awake()
        {
            // Setting up the reference.
            playerControl = GameObject.FindGameObjectWithTag("Player").GetComponent <Platformer2DUserControl>();
        }
Exemplo n.º 4
0
        private int previousScore = 0; // The score in the previous frame.

        #endregion Fields

        #region Methods

        void Awake()
        {
            // Setting up the reference.
            playerControl = GameObject.FindGameObjectWithTag("Player").GetComponent<Platformer2DUserControl>();
        }