public static void Start(StgEventAbs stgEvent) { switch (stgEvent.type) { case StgEventType.HeroBorn: StgHeroBornDealer.Start(stgEvent); break; case StgEventType.ZombieBorn: StgZombieBornDealer.Start(stgEvent); break; case StgEventType.HeroMove: break; case StgEventType.PrefabBorn: break; case StgEventType.PrefabBornZombie: break; case StgEventType.Conversation: break; case StgEventType.NPCMove: break; } }
public void CreateZombie(StgZombieBornDealer zombieDealer) { Transform trans = UnityEngine.Object.Instantiate(PrefabResources.Get("Zombie/" + zombieName)); trans.position = this.position + new Vector3(UnityEngine.Random.Range(-this.range, this.range), 0.3f, UnityEngine.Random.Range(-this.range, this.range)); trans.eulerAngles = new Vector3(0f, (float)UnityEngine.Random.Range(0, 360), 0f); ZombieAbs zombieAbs = trans.GetComponent <ZombieAbs>(); zombieAbs.Agent.Warp(trans.position); zombieAbs.zombieDieDelegate = (Action <ZombieAbs>)Delegate.Combine(zombieAbs.zombieDieDelegate, new Action <ZombieAbs>(zombieDealer.HandleZombieDie)); trans.gameObject.SetActive(true); StgZombieBornDealer.zombies.Add(zombieAbs); }
public void Update(StgZombieBornDealer zombieDealer) { if (this.isWaiting) { this.timer += Time.deltaTime; if (this.timer >= this.delay) { this.isWaiting = false; this.timer = 10000f; } } if (!this.isWaiting && (this.nowCount < this.count)) { this.timer += Time.deltaTime; if (this.timer >= this.interval) { this.timer = 0f; this.interval = UnityEngine.Random.Range(this.minInterval, maxInterval); this.CreateZombie(zombieDealer); this.nowCount++; zombieDealer.nowCount++; } } }
private void ClearZombieInformation() { StgZombieBornDealer.Clear(); ZombieAudioManager.INSTANCE.ClearAll(); }