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; } }
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); }
public void Enter() { IsRunning = true; opossum.GetComponent <SpriteRenderer>().flipX = direction > 0 ? true : false; }