Exemplo n.º 1
0
    public void ResetLevel()
    {
        for (int Tr = 0; Tr < Trs.Length; Tr++)
        {
            Trs[Tr].localPosition = StartPositions[Tr];
            Trs[Tr].localRotation = StartRotations[Tr];

            if (Rigids[Tr] && !Rigids[Tr].isKinematic)
            {
                Rigids[Tr].velocity        = Vector3.zero;
                Rigids[Tr].angularVelocity = Vector3.zero;

                if (SleepOnStart)
                {
                    Rigids[Tr].Sleep();
                }
            }
        }

        foreach (Target T in Targets)
        {
            T.Reset();
        }

        foreach (MovingPlatform MP in Platforms)
        {
            MP.Reset();
        }

        foreach (Windmill W in Windmills)
        {
            W.Reset();
        }

        foreach (Flipper F in Flippers)
        {
            F.Reset();
        }

        foreach (Barrel B in Barrels)
        {
            B.Reset();
        }

        Win = false;

        ResetCount++;
    }