Beispiel #1
0
    public void ResetSphere()
    {
        if (sphere == null)
        {
            return;
        }

        if (sphere.transform.position.y < -20)
        {
            if (generateGravity != null)
            {
                generateGravity.SetIsGravity = false;

                if (particleController != null)
                {
                    particleController.Stop();
                }

                sphere.transform.position = resetPos;
                generateGravity.ResetVelocity();
                generateGravity.SetIsGravity = true;


                if (particleController != null)
                {
                    particleController.Play();
                }
            }
        }
    }
Beispiel #2
0
    private void StopPlayer()
    {
        if (player == null)
        {
            return;
        }

        if (generateGravity != null)
        {
            generateGravity.SetIsGravity = false;

            if (particleController != null)
            {
                particleController.Stop();
            }

            player.transform.position = resetPos;
            generateGravity.ResetVelocity();
            generateGravity.SetIsKinematic(true);
        }
    }