Esempio n. 1
0
    public void Init(SignalSystem.Info info, Sender sender)
    {
        this.Info          = info;
        transform.position = info.Source;
        spawnTime          = Time.time;

        Sender = sender;

        var ems = ParticleSystem.emission;

        ems.rateOverTime = 0f;

        var main = ParticleSystem.main;

        main.startLifetime = info.Lifetime;
        main.duration      = info.Lifetime;
        main.loop          = false;

        ParticleSystem.Emit(info.Particles.Length);
        ParticleSystem.GetParticles(info.Particles);
    }
Esempio n. 2
0
    private void ProcessCollider(Collider collider, SignalSystem.Info info, ParticleSystem.Particle p, int i)
    {
        var agent = collider.GetComponent <Agent>();

        if (agent != null)
        {
            agent.Hit(this);
        }
        var wall = collider.GetComponent <Wall>();

        if (wall != null)
        {
            // GameObject.Destroy(gameObject);
            p.velocity        = Vector3.zero;
            p.position        = Vector3.one * 10000f;
            info.Particles[i] = p;
        }
        var powerUp = collider.GetComponent <PowerUpScript>();

        if (powerUp != null)
        {
            powerUp.Hit(this);
        }
    }