Ejemplo n.º 1
0
    public void CreateSonar(Vector3 _pos, float lifeTime = 0, float startSpeed = 0)
    {
        if (!poolExist)
        {
            return;
        }

        ParticleBehaviour _part = pool.Dequeue();

        _part.gameObject.SetActive(true);
        _part.gameObject.transform.position = _pos;

        if (lifeTime > 0)
        {
            _part.SetLifeTime(lifeTime);
        }

        if (startSpeed > 0)
        {
            _part.SetStartSpeed(startSpeed);
        }

        _part.PlayParticle();

        pool.Enqueue(_part);
    }
Ejemplo n.º 2
0
    private void RPC_Ping(float beginSpeed = 0, float lifeTime = 0)
    {
        if (!isInitialized)
        {
            return;
        }

        if (beginSpeed == 0)
        {
            beginSpeed = baseSettings.basePingBeginSpeed;
        }
        if (lifeTime == 0)
        {
            lifeTime = baseSettings.basePingLifeTime;
        }

        pb.SetStartSpeed(beginSpeed);
        pb.SetLifeTime(lifeTime);

        pb.PlayParticle();
    }