コード例 #1
0
    private IEnumerator CheckState()
    {
        yield return(0);

        //Debug.Log("Checkstate");
        int  i            = 0;
        bool puzzleSolved = true;

        foreach (LeverAnimatedInteractable it in switches)
        {
            bool switchStateExpected = order[i];
            //Debug.Log("Switch: " + it.name + " : " + it.activated);
            //Debug.Log("Order: " + i + " : " + switchStateExpected);
            if (it.activated != switchStateExpected)
            {
                puzzleSolved = false;
            }
            i++;
        }
        if (puzzleSolved)
        {
            Debug.Log("PUZZLE SOLVED!");
            foreach (LeverAnimatedInteractable it in switches)
            {
                it.Disable();
            }
            triggerManager.ActivateReactors();
        }
        else
        {
            triggerManager.DeactivateReactors();
        }
    }
コード例 #2
0
 public void OnTriggerExit2D(Collider2D collider)
 {
     // react to trigger
     if (interactableLayer == (interactableLayer | (1 << collider.gameObject.layer)))
     {
         if (triggerManager != null)
         {
             triggerManager.DeactivateReactors();
         }
     }
 }
コード例 #3
0
    IEnumerator BossKilledCoroutine()
    {
        GuiController.GetInstance().CanvasFlash();
        triggerManagerActivateOnFight.DeactivateReactors();

        yield return(new WaitForSeconds(waitTimePommesgabelAfterBossDead));

        InputController.GetInstance().moveInputEnabled = false;
        GuiController.GetInstance().ShowFantasyText("Berserk!", showNewTitleTime);
        PlayerController.GetInstance().InterruptState(AbstractState.ACTION.POMMESGABEL);

        StartCoroutine(ShowNewStatsCoroutine(showNewTitleTime + 1));
    }
コード例 #4
0
 public override void Activate()
 {
     if (!permanentDisabled)
     {
         if (activated)
         {
             // deactivate
             bool changeState = true;
             if (triggerManager.HasReactors())
             {
                 changeState = triggerManager.DeactivateReactors();
             }
             if (changeState)
             {
                 ChangeState(OFF_ACTIVE);
                 activated = false;
             }
         }
         else
         {
             // activate
             bool startMoving = true;
             if (triggerManager.HasReactors())
             {
                 startMoving = triggerManager.ActivateReactors();
             }
             if (oneTimeUse)
             {
                 permanentDisabled = true;
                 actionArrow.SetActive(false);
             }
             if (startMoving)
             {
                 if (!permanentDisabled)
                 {
                     ChangeState(ON_ACTIVE);
                 }
                 else
                 {
                     ChangeState(ON);
                 }
                 activated = true;
             }
         }
     }
     actionFinished = true;
 }
コード例 #5
0
 public override void Activate()
 {
     if (activated && !permanentDisabled)
     {
         // deactivate
         bool startMoving = true;
         if (triggerManager.HasReactors())
         {
             startMoving = triggerManager.DeactivateReactors();
         }
         if (startMoving)
         {
             sr.sprite = leverSpriteOff;
             activated = false;
         }
     }
     else
     {
         // activate
         if (!permanentDisabled)
         {
             bool startMoving = true;
             if (triggerManager.HasReactors())
             {
                 startMoving = triggerManager.ActivateReactors();
             }
             if (startMoving)
             {
                 sr.sprite = leverSpriteOn;
                 activated = true;
             }
             if (oneTimeUse)
             {
                 permanentDisabled = true;
                 actionArrow.SetActive(false);
             }
         }
     }
     actionFinished = true;
 }
コード例 #6
0
    public override void Update()
    {
        if (!everythingFinished)
        {
            if (!fightStarted && !dialogueFinished && inDialogue)
            {
                // check if Dialogue finished
                if (!dialogue.inDialogue && !inFight)
                {
                    inFight = true;
                    StartCoroutine(StartEffect());
                    dialogueFinished = true;
                }
            }
            if (fightStarted && !fightFinished)
            {
                // check if boss is still alive
                if (!boss)
                {
                    StartCoroutine(BossKilledCoroutine());
                    fightFinished = true;
                }
            }

            if (fightFinished && showNewStats)
            {
                if (Input.anyKeyDown)
                {
                    PlayerController.GetInstance().InterruptState(AbstractState.ACTION.SWORD_UP);
                    newStatsTextbox.HideTextBox();
                    InputController.GetInstance().moveInputEnabled = true;
                    StartCoroutine(CameraFollow.GetInstance().MoveCameraBack(1F, transform.position));

                    triggerManagerActivateOnStart.DeactivateReactors();
                    triggerManagerActivateOnEnd.ActivateReactors();
                    everythingFinished = true;
                }
            }
        }
    }
コード例 #7
0
 public override void Activate()
 {
     actionFinished = false;
     if (activated && !permanentDisabled)
     {
         // deactivate
         bool startMoving = triggerManager.DeactivateReactors();
         if (startMoving)
         {
             anim.SetBool("STOP", false);
             anim.SetBool("INTERACTABLE", false);
             anim.SetBool("START", true);
             activated = false;
         }
     }
     else
     {
         // activate
         if (!permanentDisabled)
         {
             bool startMoving = triggerManager.ActivateReactors();
             if (startMoving)
             {
                 anim.SetBool("STOP", false);
                 anim.SetBool("INTERACTABLE", false);
                 anim.SetBool("START", true);
                 activated = true;
             }
             if (oneTimeUse)
             {
                 permanentDisabled = true;
                 actionArrow.SetActive(false);
             }
         }
     }
 }