Inheritance: UnityEngine.MonoBehaviour
コード例 #1
0
ファイル: Cursor.cs プロジェクト: kyapp69/Multiplier
        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);
        }
コード例 #2
0
ファイル: Cursor.cs プロジェクト: tommai78101/Multiplier
        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);
        }
コード例 #3
0
        public void Start()
        {
            TutorialAIManager.Instance = this;

            this.isInitialized = false;

            this.isTutorialFinished = false;
            this.delay = 0f;
            this.delayInterval = 0f;
            this.dialogueSectionCounter = 0;
            this.currentTutorialStage = Parts.Introduction;
            this.dialogue = StringConstants.Values(this.currentTutorialStage, this.dialogueSectionCounter);
            this.dialogueSectionCounter++;
            this.stringLetterCounter = 0;
            this.startTextRollingFlag = true;
            if (this.dialogueText != null) {
                this.dialogueText.text = "";
            }
            if (this.mainCamera == null) {
                Debug.LogError("Cannot obtain main camera. Please check.");
            }
            this.cameraOrigin = this.mainCamera.transform.position;

            this.mainCameraPanning = this.mainCamera.GetComponent<CameraPanning>();
            if (this.mainCameraPanning != null) {
                this.mainCameraPanning.enabled = false;
            }
            this.minimapCamera = this.minimap.GetComponent<Camera>();
            if (this.minimapCamera != null) {
                this.minimapCamera.enabled = false;
            }
            if (this.minimap == null) {
                Debug.LogError("Couldn't obtain minimap stuffs. Please check.");
            }
            if (this.nextStepButton == null) {
                Debug.LogError("The next button isn't set.");
            }
            if (this.dialogueText == null) {
                Debug.LogError("Dialogue text field is not bind to this variable.");
            }
            if (this.tutorialSections == null) {
                Debug.LogError("Tutorial sections are not set.");
            }
            if (this.dialogueBox == null) {
                Debug.LogError("Dialogue box not set.");
            }

            //Cursor setup
            GameObject obj = MonoBehaviour.Instantiate(this.cursorPrefab) as GameObject;
            obj.transform.SetParent(this.mainCanvas.transform);
            this.mainCursor = obj.GetComponent<Cursor>();
            if (this.mainCursor == null) {
                Debug.LogError("Cursor isn't obtained. Please check.");
            }

            InitializeCursorPanGroups();
            InitializeTutorial();
        }
コード例 #4
0
ファイル: Cursor.cs プロジェクト: tommai78101/Multiplier
        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;
        }
コード例 #5
0
ファイル: Cursor.cs プロジェクト: tommai78101/Multiplier
        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;
        }
コード例 #6
0
        public void Start()
        {
            TutorialAIManager.Instance = this;

            this.isInitialized = false;

            this.isTutorialFinished = false;
            this.delay                  = 0f;
            this.delayInterval          = 0f;
            this.dialogueSectionCounter = 0;
            this.currentTutorialStage   = Parts.Introduction;
            this.dialogue               = StringConstants.Values(this.currentTutorialStage, this.dialogueSectionCounter);
            this.dialogueSectionCounter++;
            this.stringLetterCounter  = 0;
            this.startTextRollingFlag = true;
            if (this.dialogueText != null)
            {
                this.dialogueText.text = "";
            }
            if (this.mainCamera == null)
            {
                Debug.LogError("Cannot obtain main camera. Please check.");
            }
            this.cameraOrigin = this.mainCamera.transform.position;

            this.mainCameraPanning = this.mainCamera.GetComponent <CameraPanning>();
            if (this.mainCameraPanning != null)
            {
                this.mainCameraPanning.enabled = false;
            }
            this.minimapCamera = this.minimap.GetComponent <Camera>();
            if (this.minimapCamera != null)
            {
                this.minimapCamera.enabled = false;
            }
            if (this.minimap == null)
            {
                Debug.LogError("Couldn't obtain minimap stuffs. Please check.");
            }
            if (this.nextStepButton == null)
            {
                Debug.LogError("The next button isn't set.");
            }
            if (this.dialogueText == null)
            {
                Debug.LogError("Dialogue text field is not bind to this variable.");
            }
            if (this.tutorialSections == null)
            {
                Debug.LogError("Tutorial sections are not set.");
            }
            if (this.dialogueBox == null)
            {
                Debug.LogError("Dialogue box not set.");
            }

            //Cursor setup
            GameObject obj = MonoBehaviour.Instantiate(this.cursorPrefab) as GameObject;

            obj.transform.SetParent(this.mainCanvas.transform);
            this.mainCursor = obj.GetComponent <Cursor>();
            if (this.mainCursor == null)
            {
                Debug.LogError("Cursor isn't obtained. Please check.");
            }

            InitializeCursorPanGroups();
            InitializeTutorial();
        }
コード例 #7
0
ファイル: Cursor.cs プロジェクト: kyapp69/Multiplier
        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);
        }
コード例 #8
0
ファイル: Cursor.cs プロジェクト: kyapp69/Multiplier
        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);
        }