public StunBullet SetStunBullet(QueenMushroom queen, Vector3 from, Vector3 target) { StunBullet stunbullet = GetStunBullet(); stunbullet.InitStunBullet(queen, from, target); return(stunbullet); }
protected override void Start() { base.Start(); if (_stunBulletPrefab == null) { _stunBulletPrefab = Resources.Load <StunBullet>("Prefabs/Mechanics/StunBullet"); } }
private StunBullet CreateStunBullet() { StunBullet stunbullet = null; GameObject stunbulletObject = (GameObject)Resources.Load("Prefabs/Bullets/StunBullet"); stunbullet = Instantiate(stunbulletObject).GetComponent <StunBullet>(); stunbullet.transform.SetParent(transform); stunbullet.gameObject.SetActive(false); _stunBullets.Add(stunbullet); return(stunbullet); }
private StunBullet GetStunBullet() { StunBullet stunbullet = null; foreach (StunBullet s in _stunBullets) { if (s.gameObject.activeInHierarchy) { continue; } stunbullet = s; } if (stunbullet == null) { stunbullet = CreateStunBullet(); } stunbullet.gameObject.SetActive(true); return(stunbullet); }