void Awake() { GameObject gameObjectES = GameObject.Find("ES"); es = gameObjectES.GetComponentInChildren <EarthShaker>(); source = GetComponent <AudioSource>(); source.PlayOneShot(soundEarthSkill, Random.Range(0.3f, 0.6f)); }
void Start() { anim = GetComponent <Animator>(); GameObject gameObjectPoint = GameObject.FindWithTag("PointsDemonFollow"); pointMarauder = gameObjectPoint.GetComponentInChildren <PointEnemyFollow>(); target = pointMarauder.pointTransform[0]; heroEarthShaker = GameObject.Find("ES"); es = heroEarthShaker.GetComponent <EarthShaker>(); UIGamePlay = GameObject.Find("UIGamePlay"); }
void Start() { anim = GetComponent <Animator>(); GameObject gameObjectPoint = GameObject.Find("PointsEnemyFollow"); pointEnemyFollow = gameObjectPoint.GetComponent <PointEnemyFollow>(); target = pointEnemyFollow.pointTransform[0]; heroEarthShaker = GameObject.Find("ES"); es = heroEarthShaker.GetComponent <EarthShaker>(); UIGamePlay = GameObject.Find("UIGamePlay"); }
private void Attack() { if (gameObjectChoosedToAttack != null && gameObjectChoosedToAttack.layer == 10) { es = gameObjectChoosedToAttack.GetComponentInChildren <EarthShaker>(); es.SubHealth(damageBasic); } else if (gameObjectChoosedToAttack != null && gameObjectChoosedToAttack.layer == 11) { dwarf = gameObjectChoosedToAttack.GetComponentInChildren <Dwarf>(); dwarf.SubHealth(damageBasic); } else if (gameObjectChoosedToAttack != null && gameObjectChoosedToAttack.layer == 12) { naga = gameObjectChoosedToAttack.GetComponentInChildren <NagaSiren>(); naga.SubHealth(damageBasic); } }
void Awake() { targetPosition = new Vector2(transform.position.x, transform.position.y); es = earthShaker.GetComponentInChildren <EarthShaker>(); chooseHero = earthShaker.GetComponentInChildren <ChooseHero>(); }