Beispiel #1
0
    private void Update()
    {
        if (UserInputHandler.CheckAtomicStepIndex())
        {
            possibilityOfNext = true;
        }
        else
        {
            possibilityOfNext = false;
        }

        if (UserInputHandler.CheckLaserPointer())
        {
            possibilityOfPointedAction = true;
        }
        else
        {
            possibilityOfPointedAction = false;
        }

        switch (index)
        {
        case 1:
            if (possibilityOfNext)
            {
                tm.color = col;
                tm.text  = "Next step in trace (Auto-next :" + (AutoNext.autoNextActivated ? "on)" : "off)");
            }
            else
            {
                tm.color = Color.red;
                tm.text  = "Please wait for current events to finish (Auto-next :" + (AutoNext.autoNextActivated ? "on)" : "off)");
            }
            break;

        case 2:
            if (possibilityOfNext)
            {
                if (possibilityOfPointedAction)
                {
                    tm.color = col;
                    tm.text  = "Drop from pointed actor";
                }
                else
                {
                    tm.color = Color.red;
                    tm.text  = "Only possible when poiniting at an actor";
                }
            }
            else
            {
                tm.color = Color.red;
                tm.text  = "Please wait for current events to finish";
            }
            break;

        case 3:
            if (possibilityOfNext)
            {
                if (possibilityOfPointedAction)
                {
                    tm.color = col;
                    tm.text  = "Receive from pointed actor";
                }
                else
                {
                    tm.color = Color.red;
                    tm.text  = "Only possible when poiniting at an actor";
                }
            }
            else
            {
                tm.color = Color.red;
                tm.text  = "Please wait for current events to finish";
            }
            break;

        case 4:
            if (possibilityOfPointedAction)
            {
                tm.color = col;
                tm.text  = "Query state on / off";
            }
            else
            {
                tm.color = Color.red;
                tm.text  = "Only possible when poiniting at an actor";
            }
            break;

        case 5:
            if (possibilityOfPointedAction)
            {
                tm.color = col;
                tm.text  = "Tag / Untag pointed actor";
            }
            else
            {
                tm.color = Color.red;
                tm.text  = "Only possible when poiniting at an actor";
            }
            break;

        case 6:
            if (possibilityOfPointedAction)
            {
                tm.color = col;
                tm.text  = "Mark upcoming message";
            }
            else
            {
                tm.color = Color.red;
                tm.text  = "Only possible when poiniting at an actor";
            }
            break;

        case 7:
            tm.text = "Go faster. Current speed is " + SpeedControl.speed.ToString() + "x";
            break;

        case 8:
            tm.text = "Go slower. Current speed is " + SpeedControl.speed.ToString() + "x";
            break;

        case 9:
            if (possibilityOfPointedAction)
            {
                tm.color = col;
                tm.text  = "Suppress / Unsuppress actor";
            }
            else
            {
                tm.color = Color.red;
                tm.text  = "Only possible when poiniting at an actor";
            }
            break;
        }
    }
Beispiel #2
0
 private void Awake()
 {
     gameInputHandler = gameObject.AddComponent <UserInputHandler>();
     gameInputHandler.Init(this);
 }