Пример #1
0
    public StunBullet SetStunBullet(QueenMushroom queen, Vector3 from, Vector3 target)
    {
        StunBullet stunbullet = GetStunBullet();

        stunbullet.InitStunBullet(queen, from, target);

        return(stunbullet);
    }
Пример #2
0
 protected override void Start()
 {
     base.Start();
     if (_stunBulletPrefab == null)
     {
         _stunBulletPrefab = Resources.Load <StunBullet>("Prefabs/Mechanics/StunBullet");
     }
 }
Пример #3
0
    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);
    }
Пример #4
0
    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);
    }