コード例 #1
0
 private void ResetResetButton()
 {
     resetButton.SetIsActivated(false);
 }
コード例 #2
0
    void Update()
    {
        bool canSkipStep = currentStep < GameManager.puzzleStep[2];

        if (canSkipStep)
        {
            switch (currentStep)
            {
            case 0:
                plate.setIsActivated(true);
                gates[0].Complete();
                currentStep++;
                break;

            case 1:
                currentStep++;
                break;

            case 2:
                target.SetIsActivated(true);
                gates[1].Complete();
                foreach (LoopingObject lo in stones)
                {
                    lo.trigger = true;
                }
                currentStep++;
                Destroy(this);
                break;

            default: break;
            }
        }
        else
        {
            switch (currentStep)
            {
            case 0:     //Shooting target
                if (target.GetIsActivated())
                {
                    gates[0].trigger = true;
                    currentStep++;
                }
                break;

            case 1:     //Pressure plate
                if (plate.GetIsActivated())
                {
                    cam.Activate();
                    currentStep++;
                }
                break;

            case 2:     //End of puzzle
                if (cam.locationReached)
                {
                    gates[1].trigger = true;
                    foreach (LoopingObject lo in stones)
                    {
                        lo.trigger = true;
                    }
                    Destroy(this);
                }
                break;

            default: break;
            }
            if (GameManager.puzzleStep[2] != currentStep)
            {
                GameManager.puzzleStep[2] = currentStep;
            }
        }
    }
コード例 #3
0
    void Update()
    {
        bool canSkipStep = currentStep < GameManager.puzzleStep[0];

        if (canSkipStep)
        {
            switch (currentStep)
            {
            case 0:
                gate.Complete();
                pressurePlates[0].setIsActivated(true);
                pressurePlates[1].setIsActivated(true);
                currentStep++;
                break;

            case 1:
                rock.Complete();
                shootingTarget.SetIsActivated(true);
                currentStep++;
                break;

            case 2:
                Destroy(part);
                currentStep++;
                break;

            case 3:
                fallingRock.Complete();
                currentStep++;
                break;

            case 4:
                Destroy(this);
                break;

            default: break;
            }
        }
        else
        {
            switch (currentStep)
            {
            case 0:
                if (AllPlatesActivated())
                {
                    gate.trigger = true;
                    currentStep++;
                }
                break;

            case 1:
                if (shootingTarget.GetIsActivated())
                {
                    rock.trigger = true;
                    currentStep++;
                }
                break;

            case 2:
                if (part.GetComponent <PickUpPart>().pickedUp)
                {
                    Destroy(part);
                    currentStep++;
                    cutsceneCam.Activate();
                    fallingRock.trigger = true;
                }
                break;

            case 3:
                if (checkpoint)
                {
                    checkpoint.Activate();
                }
                Destroy(this);
                break;

            default: break;
            }
            if (GameManager.puzzleStep[0] != currentStep)
            {
                GameManager.puzzleStep[0] = currentStep;
            }
        }
    }