Exemple #1
0
        public void DragSelectionBox(Camera main, CursorPanGroup group, CursorButton button, TutorialAIManager manager, float delayTime, string methodName)
        {
            BoxSelector selector = main.GetComponent <BoxSelector>();

            if (selector == null)
            {
                Debug.LogError("Cannot find Box Selector component from camera, " + main.ToString() + ".");
                return;
            }

            if (button != CursorButton.Left_Click)
            {
                Debug.LogError("Selection box only works with left mouse button.");
                return;
            }

            selector.StartBoxSelection(group, 0.5f);
            this.icon.SetButton(button);
            this.buttonPressedElapsedTime = 0f;
            this.isButtonPressed          = true;
            this.isButtonHeld             = true;
            this.isAppearing            = true;
            this.panningElapsedTime     = 0f;
            this.startingPosition       = group.start;
            this.endingPosition         = group.end;
            this.rectTransform.position = group.start;

            manager.Invoke(methodName, delayTime);
            this.Invoke("HeldButtonRelease", delayTime);
        }
Exemple #2
0
        public bool PanCursorWithHeldAction(CursorPanGroup group, CursorButton button, TutorialAIManager manager, float delayTime, string methodName, bool heldFlag)
        {
            if (this.isPanning)
            {
                return(false);
            }

            this.startingPosition            = group.start;
            this.endingPosition              = group.end;
            this.rectTransform.localPosition = group.start;
            this.panningElapsedTime          = 0f;
            this.isAppearing = true;


            //NOTE(Thompson): I have no idea what the codes below are doing. CursorPanGroup should already have the coordinates set before this.
            ObtainStartingPosition s = this.GetComponentInChildren <ObtainStartingPosition>();

            s.rectTransform.localPosition = group.start;
            ObtainEndingPosition e = this.GetComponentInChildren <ObtainEndingPosition>();

            e.rectTransform.localPosition = group.end;

            if (!button.Equals(CursorButton.Nothing))
            {
                this.icon.SetButton(button);
                this.buttonPressedElapsedTime = 0f;
                this.isButtonPressed          = true;
                this.isButtonHeld             = heldFlag;
            }

            manager.Invoke(methodName, delayTime);
            return(true);
        }
Exemple #3
0
        public bool PanCursorWithAction(CursorPanGroup group, CursorButton button, TutorialAIManager manager, float delayTime, string methodName)
        {
            if (this.isPanning)
            {
                return(false);
            }

            this.startingPosition            = group.start;
            this.endingPosition              = group.end;
            this.rectTransform.localPosition = group.start;
            this.panningElapsedTime          = 0f;
            this.isAppearing = true;


            ObtainStartingPosition s = this.GetComponentInChildren <ObtainStartingPosition>();

            s.rectTransform.localPosition = group.start;
            ObtainEndingPosition e = this.GetComponentInChildren <ObtainEndingPosition>();

            e.rectTransform.localPosition = group.end;

            if (!button.Equals(CursorButton.Nothing))
            {
                this.icon.SetButton(button);
                this.buttonPressedElapsedTime = 0f;
                this.isButtonPressed          = true;
            }

            manager.Invoke(methodName, delayTime);
            return(true);
        }
Exemple #4
0
        public void DragSelectionBox(Camera main, CursorPanGroup group, CursorButton button, TutorialAIManager manager, float delayTime, string methodName)
        {
            BoxSelector selector = main.GetComponent<BoxSelector>();
            if (selector == null) {
                Debug.LogError("Cannot find Box Selector component from camera, " + main.ToString() + ".");
                return;
            }

            if (button != CursorButton.Left_Click) {
                Debug.LogError("Selection box only works with left mouse button.");
                return;
            }

            selector.StartBoxSelection(group, 0.5f);
            this.icon.SetButton(button);
            this.buttonPressedElapsedTime = 0f;
            this.isButtonPressed = true;
            this.isButtonHeld = true;
            this.isAppearing = true;
            this.panningElapsedTime = 0f;
            this.startingPosition = group.start;
            this.endingPosition = group.end;
            this.rectTransform.position = group.start;

            manager.Invoke(methodName, delayTime);
            this.Invoke("HeldButtonRelease", delayTime);
        }
Exemple #5
0
        public bool PanCursorWithHeldAction(CursorPanGroup group, CursorButton button, TutorialAIManager manager, float delayTime, string methodName, bool heldFlag)
        {
            if (this.isPanning) {
                return false;
            }

            this.startingPosition = group.start;
            this.endingPosition = group.end;
            this.rectTransform.localPosition = group.start;
            this.panningElapsedTime = 0f;
            this.isAppearing = true;

            //NOTE(Thompson): I have no idea what the codes below are doing. CursorPanGroup should already have the coordinates set before this.
            ObtainStartingPosition s = this.GetComponentInChildren<ObtainStartingPosition>();
            s.rectTransform.localPosition = group.start;
            ObtainEndingPosition e = this.GetComponentInChildren<ObtainEndingPosition>();
            e.rectTransform.localPosition = group.end;

            if (!button.Equals(CursorButton.Nothing)) {
                this.icon.SetButton(button);
                this.buttonPressedElapsedTime = 0f;
                this.isButtonPressed = true;
                this.isButtonHeld = heldFlag;
            }

            manager.Invoke(methodName, delayTime);
            return true;
        }
Exemple #6
0
        public bool PanCursorWithAction(CursorPanGroup group, CursorButton button, TutorialAIManager manager, float delayTime, string methodName)
        {
            if (this.isPanning) {
                return false;
            }

            this.startingPosition = group.start;
            this.endingPosition = group.end;
            this.rectTransform.localPosition = group.start;
            this.panningElapsedTime = 0f;
            this.isAppearing = true;

            ObtainStartingPosition s = this.GetComponentInChildren<ObtainStartingPosition>();
            s.rectTransform.localPosition = group.start;
            ObtainEndingPosition e = this.GetComponentInChildren<ObtainEndingPosition>();
            e.rectTransform.localPosition = group.end;

            if (!button.Equals(CursorButton.Nothing)) {
                this.icon.SetButton(button);
                this.buttonPressedElapsedTime = 0f;
                this.isButtonPressed = true;
            }

            manager.Invoke(methodName, delayTime);
            return true;
        }