void Start()
        {
            if (AppManager.I.Player.IsFirstContact() == false) //if this isn't the first contact disable yourself and return
            {
                gameObject.SetActive(false);
                return;
            }

            TutorialUI.SetCamera(m_oCameraUI);

            //setup first state, disable UI
            m_eTutoState = eAnturaSpaceTutoState.ANTURA_ANIM;

#if UNITY_EDITOR
#else
            GlobalUI.ShowBackButton(false);
#endif

            m_oCookieButton.gameObject.SetActive(false);
            m_oCustomizationButton.gameObject.SetActive(false);

            AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Intro, delegate() //dialogue try touch Antura
            {
                m_oAnturaBehaviour.onAnimationByClick += AdvanceTutorial;
                TutorialUI.ClickRepeat(m_oAnturaBehaviour.gameObject.transform.position + (Vector3.forward * -2) + (Vector3.up), float.MaxValue, 1);
            });
        }
示例#2
0
        private int m_iTotalBones_Local = 0; //maybe it's redundant, but can be useful for testing purpose
        #endregion

        #region INTERNALS
        void Start()
        {
            GlobalUI.ShowPauseMenu(false);
            GlobalUI.ShowBackButton(true, Exit);
            AudioManager.I.PlayMusic(m_oBackgroundMusic);
            LogManager.I.LogInfo(InfoEvent.AnturaSpace, "enter");

            m_iTotalBones_Local = AppManager.I.Player.GetTotalNumberOfBones();

            m_oTextBonesNumber.text = "" + m_iTotalBones_Local;

            //set the bone initial position behind the button

            /*
             * float _fCameraDistance = Mathf.Abs(Camera.main.transform.position.z - Camera.main.nearClipPlane);
             *
             * m_oBonePrefab.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(m_oTextBonesNumber.rectTransform.position.x, m_oTextBonesNumber.rectTransform.position.y, _fCameraDistance));
             */
            m_oBonePrefab.transform.position = m_oTextBonesNumber.transform.position;

            //Instantiate the pool of bones
            GameObject _oTempBase = new GameObject();

            m_oCookieRootContainer      = Instantiate(_oTempBase);
            m_oCookieRootContainer.name = "[Cookies]";
            Destroy(_oTempBase);


            m_aoPool     = new GameObject[m_iMaxSpawnableBones];
            m_aiUsedList = new int[m_iMaxSpawnableBones];

            for (int _iIdx = 0; _iIdx < m_iMaxSpawnableBones; ++_iIdx)
            {
                m_aoPool[_iIdx] = Instantiate(m_oBonePrefab);

                m_aoPool[_iIdx].SetActive(false);

                m_aiUsedList[_iIdx] = _iIdx;

                m_aoPool[_iIdx].transform.SetParent(m_oCookieRootContainer.transform);
            }

            //link variables
            m_oAnturaBehaviour = m_oAntura.GetComponent <AnturaBehaviour>();
            m_oAnturaBehaviour.onBoneReached += release;
            m_oCustomButton.OnEnableAction   += delegate { m_oAnturaBehaviour.Reset(); m_oAnturaBehaviour.IsInCustomization = true; };
            m_oCustomButton.OnDisableAction  += delegate { m_oAnturaBehaviour.IsInCustomization = false; };
        }
示例#3
0
        void Start()
        {
            AppManager.I.GameSettings.CheatSuperDogMode = false;
            //Debug.Log("Setting super dog mode (by default) to: " + AppManager.I.GameSettings.CheatSuperDogMode);

            GlobalUI.ShowPauseMenu(false);
            GlobalUI.ShowBackButton(true, ExitThisScene);
            AudioManager.I.PlayMusic(SceneMusic);
            LogManager.I.LogInfo(InfoEvent.Book, "enter");

            SceneTransitioner.Close();

            AudioManager.I.PlayDialog("Book_Intro");

            HideAllPanels();
            OpenPanel(OpeningPanel);
        }
        /// <summary>
        /// Advance the tutorial in his sequential flow.
        /// </summary>
        public void AdvanceTutorial()
        {
            if (!gameObject.activeSelf) //block any attempt to advance if tutorial isn't active
            {
                return;
            }

            switch (m_eTutoState)
            {
            case eAnturaSpaceTutoState.ANTURA_ANIM:

                m_eTutoState = eAnturaSpaceTutoState.COOKIE_BUTTON;

                TutorialUI.Clear(false);

                m_oAnturaBehaviour.onAnimationByClick -= AdvanceTutorial;

                AudioManager.I.StopDialogue(false);

                AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Intro_Touch, delegate()           //dialog Antura
                {
                    AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Intro_Cookie, delegate()      //dialog cookies
                    {
                        AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Tuto_Cookie_1, delegate() //dialog tap for cookies
                        {
                            m_oCookieButton.gameObject.SetActive(true);                                       //after the dialog make appear the cookie button
                            m_oCookieButton.onClick.AddListener(AdvanceTutorial);                             //the button can call AdvanceTutorial on click

                            //RectTransform _oRectCookieB = m_oCookieButton.gameObject.GetComponent<RectTransform>();
                            TutorialUI.ClickRepeat(m_oCookieButton.transform.position /*m_oCameraUI.ScreenToWorldPoint(new Vector3(_oRectCookieB.position.x,_oRectCookieB.position.y, m_oCameraUI.nearClipPlane))*/, float.MaxValue, 1);
                        });
                    });
                });

                break;

            case eAnturaSpaceTutoState.COOKIE_BUTTON:

                m_eTutoState = eAnturaSpaceTutoState.USE_ALL_COOKIES;

                TutorialUI.Clear(false);

                m_oCookieButton.onClick.RemoveListener(AdvanceTutorial);

                AudioManager.I.StopDialogue(false);

                AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Tuto_Cookie_2);     //dialog drag cookies

                m_bIsDragAnimPlaying = true;
                DrawRepeatLineOnCookieButton();

                //Register delegate to disable draw line after done
                UnityEngine.EventSystems.EventTrigger.Entry _oEntry = new UnityEngine.EventSystems.EventTrigger.Entry();
                _oEntry.eventID = UnityEngine.EventSystems.EventTriggerType.EndDrag;
                _oEntry.callback.AddListener((data) => { m_bIsDragAnimPlaying = false; });

                m_oCookieButton.GetComponent <UnityEngine.EventSystems.EventTrigger>().triggers.Add(_oEntry);
                break;

            case eAnturaSpaceTutoState.USE_ALL_COOKIES:

                m_eTutoState = eAnturaSpaceTutoState.CUSTOMIZE;

                TutorialUI.Clear(false);

                AudioManager.I.StopDialogue(false);

                AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Tuto_Cookie_3, delegate() //dialog get more cookies
                {
                    AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Custom_1, delegate()  //dialog customize
                    {
                        m_oCustomizationButton.gameObject.SetActive(true);                            //after the dialog make appear the customization button
                        m_oCustomizationButton.onClick.AddListener(AdvanceTutorial);

                        /*AudioManager.I.PlayDialog(Db.LocalizationDataId.AnturaSpace_Custom_2, delegate() //dialog click customize
                         * {
                         *  //Not knowing how many object there are, register to all buttons
                         *  //foreach (var it in m_oItemsParentUI.GetComponentsInChildren<UnityEngine.UI.Button>())
                         *  //{
                         *  //   it.onClick.AddListener(AdvanceTutorial);
                         *  //}
                         *  m_oCustomizationButton.onClick.AddListener(AdvanceTutorial);
                         * });
                         */

                        /*RectTransform _oRectCustomB = m_oCustomizationButton.gameObject.GetComponent<RectTransform>();
                         * TutorialUI.ClickRepeat(m_oCameraUI.ScreenToWorldPoint(new Vector3(_oRectCustomB.position.x, _oRectCustomB.position.y, m_oCameraUI.nearClipPlane)), float.MaxValue, 1);
                         */
                        TutorialUI.ClickRepeat(m_oCustomizationButton.transform.position, float.MaxValue, 1);
                    });
                });


                break;

            case eAnturaSpaceTutoState.CUSTOMIZE:

                m_eTutoState = eAnturaSpaceTutoState.FINISH;

                TutorialUI.Clear(false);

                /*//Unregister from object buttons
                 * foreach (var it in m_oItemsParentUI.GetComponentsInChildren<UnityEngine.UI.Button>())
                 * {
                 *  it.onClick.RemoveListener(AdvanceTutorial);
                 * }*/
                m_oCustomizationButton.onClick.RemoveListener(AdvanceTutorial);

                GlobalUI.ShowBackButton(true, delegate() { NavigationManager.I.GoToScene(AppScene.Map); });

                AudioManager.I.StopDialogue(false);

                AudioManager.I.PlayDialog(Db.LocalizationDataId.Map_Intro_AnturaSpace, delegate()      //dialog go to map
                {
                    //TutorialUI.ClickRepeat(m_oCameraUI.ScreenToWorldPoint(new Vector3(GlobalUI.I.BackButton.RectT.position.x, GlobalUI.I.BackButton.RectT.position.y, m_oCameraUI.nearClipPlane)), float.MaxValue, 1);
                });

                break;

            default:
                break;
            }
        }
示例#5
0
 void Start()
 {
     NavigationManager.I.CurrentScene = AppScene.GameSelector;
     GlobalUI.ShowPauseMenu(false);
     GlobalUI.ShowBackButton(true, ExitThisScene);
 }