Esempio n. 1
0
    private void Start()
    {
        Player.GetComponent <playerMovement>().Health = playerHealth;
        Player.GetComponent <playerMovement>().Damage = playerDamage;

        Wizard.GetComponent <wizardBrain>().Health = wizardHealth;
        Wizard.GetComponent <wizardBrain>().Damage = wizardDamage;

        if (Opossum != null)
        {
            Opossum.GetComponent <opossumBrain>().Health = opossumHealth;
            Opossum.GetComponent <opossumBrain>().Damage = opossumDamage;
        }
    }
Esempio n. 2
0
        public void Update()
        {
            if (delayTime >= 1)
            {
                delayTime  = 0;
                direction *= -1;
                opossum.GetComponent <SpriteRenderer>().flipX = direction > 0 ? true : false;
            }
            else
            {
                delayTime += Time.fixedDeltaTime;
            }

            opossum.transform.Translate(Vector3.right * direction * opossum.MoveSpeed * Time.fixedDeltaTime);
        }
Esempio n. 3
0
 public void Enter()
 {
     IsRunning = true;
     opossum.GetComponent <SpriteRenderer>().flipX = direction > 0 ? true : false;
 }