コード例 #1
0
        /// <summary>
        /// Change field button callback
        /// </summary>
        public void OnChangeFieldButtonClicked()
        {
            if (changeFieldPanel.activeSelf)
            {
                changeFieldPanel.SetActive(false);
                DynamicCamera.ControlEnabled = true;
            }
            else
            {
                EndOtherProcesses();
                SimUI.getSimUI().ToggleChangeFieldPanel();

                AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.ChangeField,
                                                              AnalyticsLedger.EventAction.Changed,
                                                              "Change Field Panel",
                                                              AnalyticsLedger.getMilliseconds().ToString());
            }
        }
コード例 #2
0
        public override void Start()
        {
            canvas = GameObject.Find("Canvas");
            camera = GameObject.Find("Main Camera").GetComponent <DynamicCamera>();

            tabs         = Auxiliary.FindObject(canvas, "Tabs");
            toolbar      = Auxiliary.FindObject(canvas, "MainToolbar");
            helpMenu     = Auxiliary.FindObject(canvas, "Help");
            overlay      = Auxiliary.FindObject(canvas, "Overlay");
            helpBodyText = Auxiliary.FindObject(canvas, "BodyText").GetComponent <Text>();

            changeRobotPanel = Auxiliary.FindObject(canvas, "ChangeRobotPanel");
            robotListPanel   = Auxiliary.FindObject(changeRobotPanel, "RobotListPanel");
            changePanel      = Auxiliary.FindObject(canvas, "ChangePanel");
            addPanel         = Auxiliary.FindObject(canvas, "AddPanel");
            changeFieldPanel = Auxiliary.FindObject(canvas, "ChangeFieldPanel");

            resetDropdown    = GameObject.Find("ResetRobotDropdown");
            multiplayerPanel = Auxiliary.FindObject(canvas, "MultiplayerPanel");

            stopwatchWindow = Auxiliary.FindObject(canvas, "StopwatchPanel");
            statsWindow     = Auxiliary.FindObject(canvas, "StatsPanel");
            rulerWindow     = Auxiliary.FindObject(canvas, "RulerPanel");

            inputManagerPanel = Auxiliary.FindObject(canvas, "InputManagerPanel");
            checkSavePanel    = Auxiliary.FindObject(canvas, "CheckSavePanel");

            // To access instatiate classes within a state, use the StateMachine.SceneGlobal
            toolkit          = StateMachine.SceneGlobal.GetComponent <Toolkit>();
            multiplayer      = StateMachine.SceneGlobal.GetComponent <LocalMultiplayer>();
            simUI            = StateMachine.SceneGlobal.GetComponent <SimUI>();
            robotCameraGUI   = StateMachine.SceneGlobal.GetComponent <RobotCameraGUI>();
            sensorManagerGUI = StateMachine.SceneGlobal.GetComponent <SensorManagerGUI>();

            State = StateMachine.SceneGlobal.CurrentState as MainState;

            Button helpButton = Auxiliary.FindObject(helpMenu, "CloseHelpButton").GetComponent <Button>();

            helpButton.onClick.RemoveAllListeners();
            helpButton.onClick.AddListener(CloseHelpMenu);
        }
コード例 #3
0
        /// <summary>
        /// Change robot button callback. Note: Buttons register with "On...Pressed"
        /// </summary>
        public void OnChangeRobotButtonClicked()
        {
            if (changePanel.activeSelf == true)
            {
                changePanel.SetActive(false);
            }
            else
            {
                if (SimUI.IsMaMInstalled())
                {
                    changePanel.SetActive(true);
                }
                else
                {
                    SimUI.getSimUI().ToggleChangeRobotPanel();
                }
                addPanel.SetActive(false);

                AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.ChangeRobot,
                                                              AnalyticsLedger.EventAction.Changed,
                                                              "Change Robot Panel",
                                                              AnalyticsLedger.getMilliseconds().ToString());
            }
        }