예제 #1
0
    private void OnCollisionEnter(Collision other_object)
    {
        if (other_object.gameObject.CompareTag("Cube"))
        {
            flames_transform.parent   = other_object.gameObject.transform;
            flames_transform.position = other_object.gameObject.transform.position;

            var flame_main = flames.main;
            flame_main.startLifetime = 0.5f;

            var flame_emission = flames.emission;
            flame_emission.rateOverTime = 500;

            camshake.InduceStress(5, 8, 1f);
            particles.PlayerDestroyed(transform.position);
            gm.GameOver();
        }

        else if (other_object.gameObject.CompareTag("Cube_target")) // Destroyable Cube //
        {
            Destroy(other_object.gameObject);
            camshake.InduceStress(2, 2, 1f);
            particles.ObjectDestroyed(other_object.transform.position);
            ChangeColor(Color_Randomizer(), Sphere_Renderer);
            score.IncrementScore(10);
        }
    }
예제 #2
0
    private void OnCollisionStay(Collision other_object)
    {
        if (other_object.gameObject.CompareTag("Wall"))
        {
            isExited      = false;
            outline_Color = Color.Lerp(getOutlineColor(), Color.red, 0.3f);
            setOutlineColor(outline_Color);

            if (outline_Color == targetColor)
            {
                camshake.InduceStress(5, 8, 1f);
                particles.PlayerDestroyed(transform.position);
                gm.GameOver();
            }
        }
    }