コード例 #1
0
    void SplatOnTheWall(Vector2 pos)
    {
        GameObject splat = Instantiate(splatPrefab, pos, Quaternion.identity);

        if (splatHolder != null)
        {
            splat.transform.SetParent(splatHolder);
        }

        Splat splatScript = splat.GetComponent <Splat>();

        splatScript.CreateSplat(Splat.SplatLocation.Background);
    }
コード例 #2
0
    private void OnParticleCollision(GameObject other)
    {
        ParticlePhysicsExtensions.GetCollisionEvents(splatSystem, other, collisionEvents);

        for (int i = 0; i < collisionEvents.Count; i++)
        {
            Vector2    pos   = collisionEvents[i].intersection;
            GameObject splat = Instantiate(splatPrefab, new Vector2(pos.x, pos.y - Random.Range(0.0f, 0.5f)), Quaternion.identity);
            if (splatHolder != null)
            {
                splat.transform.SetParent(splatHolder);
            }

            Splat splatScript = splat.GetComponent <Splat>();
            splatScript.CreateSplat(Splat.SplatLocation.Foreground);
        }
    }