Beispiel #1
0
 public void ShowParticle(ParticleKind _kind, Vector3?_pos = null, Vector3?_rot = null, int _amount = 1)
 {
     if (_amount > 1)
     {
         for (int i = 0; i < _amount; i++)
         {
             _particlePool.Find()._kind = _kind;
             _particlePool?.Spawn(_pos ?? Vector3.zero, _rot ?? Vector3.zero, null);
         }
         return;
     }
     else
     {
         _particlePool.Find()._kind = _kind;
         _particlePool?.Spawn(_pos ?? Vector3.zero, _rot ?? Vector3.zero, null);
     }
 }
Beispiel #2
0
    //----------------------------------------------------------------------------------------------------
    /// <summary>
    /// パーティクルの生成
    /// </summary>
    /// <param name="particleKind">パーティクル種類</param>
    /// <returns>生成されたパーティクル</returns>
    public ParticleSystem CreateParticle(ParticleKind particleKind)
    {
        m_workParticleSystem = null;

        //パーティクル種類
        switch (particleKind)
        {
        case ParticleKind.VirusDethblow:
            m_workParticleSystem = Instantiate(VirusDethblowParticle.gameObject, transform).GetComponent <ParticleSystem>();
            break;

        case ParticleKind.PickUpMask:
            m_workParticleSystem = Instantiate(PickUpMaskParticle.gameObject, transform).GetComponent <ParticleSystem>();
            break;
        }

        return(m_workParticleSystem);
    }