IEnumerator isAttackGround(float time) { time += Time.deltaTime; if (!sulfuras.GetComponent <Sulfuars>().isCollide || time <= 1f) { yield return(new WaitForEndOfFrame()); StartCoroutine(isAttackGround(time)); } else { yield return(null); Vector3 pos = sulfuras.transform.localPosition; pos.y = 0; KOFItem.InstantiateByPool(fireStamp, pos, Quaternion.Euler(0, 90, 0), GameController.instance.transform, gameObject.layer); GameObject[] traps = GameController.Register.LeftHero.HeroRegister.SearchCompontent("FireTrap"); GameObject[] nearbytrips; int n_near; n_near = isTrapNearby(traps, out nearbytrips); if (n_near != 0) { FireWall instance = KOFItem.InstantiateByPool(fireWall, pos, Quaternion.Euler(0, 90, 0), GameController.instance.transform, gameObject.layer); instance.damage = new RagnarosDamage(n_near * 50, DamageType.Fire, gameObject.layer); foreach (GameObject go in nearbytrips) { go.GetComponent <FireTrap>().BeTrumped(); } } //gameObject.GetComponent<RagnarosFireWall>().StartSkill(n_near); } }
IEnumerator SeedGo(int i) { yield return(new WaitForEndOfFrame()); GameObject go = seed_copy[i]; go.transform.LookAt(targets[i].transform.position); go.transform.position += go.transform.forward * Time.deltaTime * 5; float dis = Vector3.Distance(targets[i].transform.position, go.transform.position); if (dis >= 0.2f) { StartCoroutine(SeedGo(i)); } else { KOFItem.InstantiateByPool(fireElement, targets[i].transform.position += new Vector3(0, 0.3f, 0), new Quaternion(), GameController.instance.transform, gameObject.layer, true); targets[i].GetComponent <FireTrap>().BeTrumped(); seed_copy[i].SetActive(false); seed_copy[i].transform.localPosition = Vector3.zero; Num--; if (Num == 0) { StartCoroutine(DestorySelf()); } } }
public override void StartSkill(Animator animator) { hero.state.Mana -= manaCost; effectInstance = KOFItem.InstantiateByPool(effect, LeftHand.transform, gameObject.layer); effectInstance.GetComponent <FireDebuff>().target = target; StartCoroutine(WaitTime()); }
public override void StartSkill(Animator animator) { summonField = KOFItem.InstantiateByPool(summonField, GameController.instance.transform, gameObject.layer); summonField.transform.localPosition = hero.transform.localPosition; wurmInstance = KOFItem.InstantiateByPool(wurm, new Vector3(-30, 5.13f, 0), GameController.instance.transform, gameObject.layer); wurmInstance.transform.localRotation = Quaternion.Euler(0, 180, 0); }
public override void StartSkill(Animator animator) { hero.state.Mana -= manaCost; KOFItem.InstantiateByPool(fireStormParticle, pos, rot, Camera.main.transform, gameObject.layer); StartCdColding(); hero.statusBox.cdBar.StartCooling(skillIcon, cd); }
IEnumerator startSkill(Animator animator) { yield return(new WaitForSeconds(3)); varkierInstance = KOFItem.InstantiateByPool(varkier, GameController.instance.transform, gameObject.layer); varkierInstance.transform.localPosition = hero.transform.localPosition + relativePos; animator.SetBool("SummonVar", false); }
public void StartBehave() { float x = UnityEngine.Random.Range(-6f, 2f); Vector3 RandomPosition = new Vector3(x, 0.2f, 0); instance = KOFItem.InstantiateByPool(trap, RandomPosition, GameController.instance.transform, gameObject.layer); instance.speller = hero; }
public override void StartSkill(Animator animator) { hero.state.Mana -= manaCost; var instance = KOFItem.InstantiateByPool(fireBlower, GameController.instance.transform, gameObject.layer); instance.damage = new RagnarosDamage(damageVal, damageType, gameObject.layer); StartCdColding(); hero.statusBox.cdBar.StartCooling(skillIcon, cd); }
public override void StartSkill(Animator animator) { StartCdColding(); if (fireBallInstance == null) { damageVal = initialDamage; fireBallInstance = KOFItem.InstantiateByPool(fireBall, leftHand.transform, gameObject.layer); StartCoroutine(SkillUpdate(animator)); } }
public override void StartSkill(Animator animator) { time = 0; spellTime++; hero.state.Mana -= manaCost; if (hero.state.Stage == 0) { runeBoomInstance = KOFItem.InstantiateByPool(runeBoom, initialLocalPosition, Quaternion.Euler(90, 0, 0), GameController.instance.transform, gameObject.layer); StartCoroutine(Behave(animator)); } }
void FlameCircle(int n) { Vector3[] flamePos = new Vector3[8]; for (int i = 0; i < 8; i++) { flamePos[i].y = 2.3f; flamePos[i].x = gameObject.transform.position.x + n * RadiusInterval * Mathf.Sin(Mathf.PI / 4 * i); flamePos[i].z = gameObject.transform.position.z + n * RadiusInterval * Mathf.Cos(Mathf.PI / 4 * i); KOFItem.InstantiateByPool(flame, flamePos[i], Quaternion.Euler(Vector3.zero), GameController.instance.transform, gameObject.layer, true); } }
IEnumerator startSkill(Animator animator) { yield return(new WaitForSeconds(1)); for (int i = 0; i < skeletonInstances.Length; i++) { Vector3 pos = new Vector3(UnityEngine.Random.Range(-1.5f, 1.5f), 0, UnityEngine.Random.Range(-1.5f, 1.5f)); skeletonInstances[i] = KOFItem.InstantiateByPool(skeleton, GameController.instance.transform, hero.gameObject.layer); skeletonInstances[i].transform.position = hero.transform.position + pos; yield return(new WaitForSeconds(0.57f)); } }
public override void StartSkill(Animator animator) { skinFire.gameObject.SetActive(true); fire.Play(); hero.audioCtrler.ForcePlaySound(word); pool.SetActive(false); contTime = hero.state.Mana * 1f + 2; flameInstance = KOFItem.InstantiateByPool(titantFlame, hero.transform.localPosition, GameController.instance.transform, gameObject.layer); hero.state.Mana = 0; hero.state.Stage = 3; hero.transform.localScale *= 3; hero.transform.localPosition += new Vector3(0, 3, 0); StartCoroutine(SkillBehave()); }
IEnumerator startSkill(Animator animator) { yield return(new WaitForSeconds(0.5f)); lineInstance = KOFItem.InstantiateByPool(line, GameController.instance.transform, gameObject.layer); tankInstance = KOFItem.InstantiateByPool(tank, GameController.instance.transform, gameObject.layer); tankInstance.transform.localPosition = hero.transform.localPosition + pos; var t = tankInstance.transform.position; t.y = 0; lineInstance.SetLine(weapon.spellPoint.transform, t, 0.7f, 1); yield return(new WaitForSeconds(1.4f)); StopSkill(animator); }
public override void StartSkill(Animator animator) { if (fireBallInstance.Count == 0) { fireBall.speller = hero; fireBallInstance.Add(KOFItem.InstantiateByPool(fireBall, leftHand.transform, hero, gameObject.layer)); if (hero.state.Stage == 3) { fireBallInstance.Add(KOFItem.InstantiateByPool(fireBall, leftHand.transform, hero, gameObject.layer)); fireBallInstance.Add(KOFItem.InstantiateByPool(fireBall, leftHand.transform, hero, gameObject.layer)); } foreach (var f in fireBallInstance) { f.transform.localScale = Vector3.one; } StartCoroutine(HighFireBalls(animator)); } }
IEnumerator StartSummonGhouls(Vector3[] positions, Animator animator) { yield return(new WaitForSeconds(0.5f)); int n = positions.Length; ghoulInstance = new Ghoul[n]; spriteLineInstances = new SpriteLine[n]; for (int i = 0; i < n; i++) { ghoulInstance[i] = KOFItem.InstantiateByPool(ghoul, GameController.instance.transform, gameObject.layer); ghoulInstance[i].transform.position = positions[i]; spriteLineInstances[i] = KOFItem.InstantiateByPool(spriteLine, GameController.instance.transform, gameObject.layer); spriteLineInstances[i].SetLine(hero.weapon.spellPoint.transform, positions[i]); } yield return(new WaitForSeconds(1.4f)); StopSkill(animator); }
IEnumerator behaveUpdate() { //do something //Only a reference if (Vector3.Distance(transform.position, target.transform.position) <= spellDis) { GetComponent <Animator>().CrossFade("FlyCustomSpell06 [106]", 0.1f); if (!hasBullet) { hasBullet = true; bulletInstance = KOFItem.InstantiateByPool(bullet, GameController.instance.transform, gameObject.layer); bulletInstance.Follow(this.spellHand); yield return(new WaitForSeconds(1f)); GetComponent <Animator>().CrossFade("FlyCustomSpell07 [107]", 0.1f); yield return(new WaitForSeconds(0.5f)); bulletInstance.Shoot(this.target); yield return(new WaitForSeconds(0.4f)); GetComponent <Animator>().CrossFade("Hover [101] 0", 0.1f); yield return(new WaitForSeconds(1)); hasBullet = false; } } else { GetComponent <Animator>().CrossFade("Hover [101]", 0.1f); Vector3 dir = target.transform.position - transform.position; transform.position += dir.normalized * Time.deltaTime * speed; } yield return(new WaitForEndOfFrame()); StartCoroutine(behaveUpdate()); }
protected IEnumerator SkillBehave(Animator animator) { yield return(new WaitForSeconds(1f)); sf_copy = Instantiate(sf, Hand_sf.transform, true); sf_copy.transform.localScale *= 1.5f; sf_copy.transform.SetParent(Hand_sf.transform); sfEffect_ = Instantiate(sfEffect, sf_copy.transform); var s = sfEffect_.shape; s.meshRenderer = sf_copy.GetComponentInChildren <MeshRenderer>(); sf.SetActive(false); sf_copy.transform.localRotation = Quaternion.Euler(0, 70, 0); Vector3 pos = sf_copy.transform.localPosition; stamp = KOFItem.InstantiateByPool(stamp, sf_copy.transform.localPosition, GameController.instance.transform, gameObject.layer); StartCoroutine(stamp.StopEffect(0.5f)); yield return(new WaitForSeconds(0.25f)); StartCoroutine(Dilling(0)); sf_copy.transform.SetParent(GameController.instance.transform); sf_copy.transform.position += new Vector3(0, 0.7f, 0); pos = transform.position; pos.y = 10; for (int i = 0; i < 7; i++) { pos += aeroliteinterval; FireAerolite go = KOFItem.InstantiateByPool(aerolite, pos, Quaternion.Euler(0, 0, 0), GameController.instance.transform, gameObject.layer, true); go.GetComponent <SkillItemsBehaviourController>().SetTarget(sf_copy); if (i == 3) { go.GetComponent <FireAerolite>().isSeed = true; go.speller = this.hero; } yield return(new WaitForSeconds(UnityEngine.Random.Range(0.1f, 0.3f))); } }
public override void StartSkill(Animator animator) { summonField = KOFItem.InstantiateByPool(summonField, GameController.instance.transform, gameObject.layer); summonField.transform.localPosition = hero.transform.localPosition; StartCoroutine(startSkill(animator)); }
IEnumerator Stomp() { yield return(new WaitForSeconds(0.3f)); KOFItem.InstantiateByPool(wave, foot.position, Quaternion.Euler(Vector3.zero), GameController.instance.transform, gameObject.layer, true); }