public void SetClicked(GameObject go, Action callback)
 {
     EventTriggerAssist.Get(go).LeftClick += (f) =>
     {
         if (callback != null)
         {
             callback();
         }
     };
 }
Beispiel #2
0
    private void Awake()
    {
        Debug.Log("add GameInfoView .");
        m_uiRoot         = GameObject.Find("UIRoot");
        m_startGameBtnGo = transform.FindChild("Start").gameObject;
        m_returnBtnGo    = transform.FindChild("Return").gameObject;
        m_restBtnGo      = transform.FindChild("Rest").gameObject;
        m_title          = transform.FindChild("Title/Text").GetComponent <Text>();
        m_title.text     = "";
        m_typeWordEffectScript.Add(m_title.gameObject.GetComponent <TypeWordExample>());
        m_desc      = transform.FindChild("Desc").GetComponent <Text>();
        m_desc.text = "";
        m_typeWordEffectScript.Add(m_desc.gameObject.GetComponent <TypeWordExample>());
        m_screenShot = transform.FindChild("ScreenShot/Background").GetComponent <Image>();
        m_type       = transform.FindChild("Icon/type").GetComponent <Text>();
        m_type.text  = "";
        m_typeWordEffectScript.Add(m_type.gameObject.GetComponent <TypeWordExample>());
        m_icon = transform.FindChild("Game/icon").GetComponent <Image>();

        gameObject.SetActive(false);

        EventTriggerAssist.Get(m_startGameBtnGo).LeftClick += (e) =>
        {
            Debug.Log("Start some Game");


            if (!isOpening)
            {
                isOpening = true;
                StartExternalApp();
            }
        };

        EventTriggerAssist.Get(m_returnBtnGo).LeftClick += (e) =>
        {
            for (int i = 0; i < m_typeWordEffectScript.Count; i++)
            {
                m_typeWordEffectScript[i].StopTypeWordEffect();
            }

            if (BackToGameListEvent != null)
            {
                BackToGameListEvent();
            }
        };

        EventTriggerAssist.Get(m_restBtnGo).LeftClick += (e) =>
        {
            RestUIForwardCamera();
        };
    }
Beispiel #3
0
    private void Awake()
    {
        Debug.Log("add MenuView .");
        root       = transform.GetComponent <RectTransform>();
        title      = transform.FindChild("Title").GetComponent <RectTransform>();
        line1      = transform.FindChild("line1").GetComponent <RectTransform>();
        line2      = transform.FindChild("line2").GetComponent <RectTransform>();
        line3      = transform.FindChild("line3").GetComponent <RectTransform>();
        game       = transform.FindChild("Game").GetComponent <RectTransform>();
        journey    = transform.FindChild("VRJourney").GetComponent <RectTransform>();
        movie      = transform.FindChild("Movie").GetComponent <RectTransform>();
        quit       = transform.FindChild("Quit").GetComponent <RectTransform>();
        effect_row = transform.FindChild("effect_row").gameObject;
        effect_col = transform.FindChild("effect_col").gameObject;

        text_game    = game.transform.FindChild("Text").GetComponent <Text>();
        text_journey = journey.transform.FindChild("Text").GetComponent <Text>();
        text_moive   = movie.transform.FindChild("Text").GetComponent <Text>();
        text_quit    = quit.transform.FindChild("Text").GetComponent <Text>();

        TimerManager.Add(1, Move);

        EventTriggerAssist.Get(game.gameObject).LeftClick += (e) =>
        {
            if (ShowGameEvent != null)
            {
                ShowGameEvent();
            }
        };
        EventTriggerAssist.Get(journey.gameObject).LeftClick += (e) =>
        {
            if (ShowJourneyEvent != null)
            {
                ShowJourneyEvent();
            }
        };
        EventTriggerAssist.Get(movie.gameObject).LeftClick += (e) =>
        {
            if (ShowMovieEvent != null)
            {
                ShowMovieEvent();
            }
        };
        EventTriggerAssist.Get(quit.gameObject).LeftClick += (e) =>
        {
            if (ShowQuitEvent != null)
            {
                ShowQuitEvent();
            }
        };
    }
Beispiel #4
0
    void Start()
    {
        EventTriggerAssist.Get(m_yes).LeftClick += (e) =>
        {
            if (GlobalData.m_isFirstEntered)
            {
                Application.Quit();
                return;
            }

            PlayTimeMgr.Inst.ExcuteRecord();
            GlobalData.m_isFirstEntered = true;
            Application.Quit();
        };

        EventTriggerAssist.Get(m_no).LeftClick += (e) =>
        {
            this.gameObject.SetActive(false);
        };

        this.gameObject.SetActive(false);
    }