コード例 #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
ファイル: SC_Jump.cs プロジェクト: ErikBehar/sequencer
 public override void execute(SequencePlayer player)
 {
     myPlayer = player;
     if (player.inRewindMode)
     {
         undo();
     } else
     {
         myPlayer.jumpToScene(targetSectionName, commandIndex);
     }
 }