Beispiel #1
0
    private void CastRay()
    {
        GameObject splat = Instantiate(splatPrefab, player.transform.position, Quaternion.identity);

        splat.transform.SetParent(splatHolder, true);
        Splat splatScript = splat.GetComponent <Splat>();

        splatParticles.transform.position = player.transform.position;
        splatParticles.Play();
        splatScript.Initialized(Splat.SplatLocation.Background);
    }
Beispiel #2
0
    private void OnParticleCollision(GameObject other)
    {
        ParticlePhysicsExtensions.GetCollisionEvents(splatParticles, other, collisionEvents);
        int count = collisionEvents.Count;

        for (int i = 0; i < count; i++)
        {
            GameObject splat = Instantiate(splatPrefab, collisionEvents[i].intersection, Quaternion.identity) as GameObject;
            //splat.transform.SetParent(splatHolder, true);
            Splat splatScript = splat.GetComponent <Splat>();
            splatScript.Initialized(Splat.SplatLocation.Foreground);
        }
    }