예제 #1
0
 void onButtonClick()
 {
     foreach (ChoiceModel model in currChoices)
     {
         if (model.text == UIButton.current.gameObject.transform.FindChild("Label").GetComponent <UILabel>().text)
         {
             cleanup();
             currentPlayer.jumpToScene(model.sceneNameToJump, model.sceneCommandIndexToJump);
             break;
         }
     }
 }
예제 #2
0
파일: SC_Jump.cs 프로젝트: imclab/sequencer
 override public void execute(SequencePlayer player)
 {
     myPlayer = player;
     if (player.inRewindMode)
     {
         undo();
     }
     else
     {
         string[] nicks = sequencerData.getSectionNames();
         myPlayer.jumpToScene(nicks [targetSectionIndex], commandIndex);
     }
 }
예제 #3
0
    public override void execute(SequencePlayer player)
    {
        myPlayer = player;
        if (player.inRewindMode)
            undo();
        else
        {
            //evaluate expressions and jump to winning one
            if (expressionList.Count == 0)
            {
                Debug.LogWarning("Expression Jump with zero expressions, will continue to next command!");
                myPlayer.callBackFromCommand();
            } else
            {
                int foundIndex = -1;
                for (int i = 0; i < expressionList.Count; i++)
                {
                    myPlayer.gameObject.GetComponent("Jurassic").SendMessage("evalBool", parseTextForVars(expressionList [i]));
                    if (myPlayer.lastEvalResultBool)
                    {
                        foundIndex = i;
                        break;
                    }
                }

                if (foundIndex > -1)
                {
                    myPlayer.jumpToScene(sectionNameList [foundIndex], commandIndexList [foundIndex]);
                } else
                {
                    Debug.LogWarning("Expression Jump none of the expressions evaluated to true, will continue to next command!");
                    myPlayer.callBackFromCommand();
                }
            }
        }
    }
예제 #4
0
 public override void execute(SequencePlayer player)
 {
     myPlayer = player;
     if (player.inRewindMode)
     {
         undo();
     } else
     {
         myPlayer.jumpToScene(targetSectionName, commandIndex);
     }
 }