Esempio n. 1
0
    private void OnGUI()
    {
        if (rightClickAndSelected)
        {
            GUI.Box(new Rect(mousex + mouse_offset, Screen.height - mousey - mouse_offset, 200, 50), "");
            if (GUI.Button(new Rect(mousex + mouse_offset, Screen.height - mousey - mouse_offset, 200, 50), "Assigned Agent to Task"))
            {
                foreach (selectAgent s in selectAgent.currentlySelected)
                {
                    print("Button has been clicked!");
                    GameWorldSubscriber.sendUserInput("ASSIGN|" + s.agentName + "|" + taskName);
                }

                rightClickAndSelected = false;
            }
        }
    }
    public bool OnTrigged()
    {
        bool is_compatible = false;

        if (selectAgent_vr.currentlySelected.Count != 0)
        {
            foreach (selectAgent_vr s in selectAgent_vr.currentlySelected)
            {
                is_compatible = checkIfCompatible(s);
            }
            if (is_compatible)
            {
                selectedTask.rightClickAndSelected = false;
                selectedTask = this;
                foreach (selectAgent_vr s in selectAgent_vr.currentlySelected)
                {
                    GameWorldSubscriber.sendUserInput("ASSIGN|" + s.agentName + "|" + taskName);
                }
                print("Agent has been selected, and right click has been pressed.");
                return(true);
            }
            else
            {
                rightClickAndSelected = false;
                print("Right click has been clicked, but INCORRECT AGENT SELECTED!");
                return(false);
            }
        }
        else
        {
            rightClickAndSelected = false;
            return(false);

            print("Right cick has been clicked, but NO AGENT SELECTED!");
        }
    }