public void Spawn(int a_onlineId, eCharType a_type, bool a_isOwnPlayer)
    {
        m_id          = a_onlineId;
        m_isOwnPlayer = a_isOwnPlayer;
        m_type        = a_type;
        GameObject prefab = GetPrefab();

        if (null != prefab)
        {
            if (null != m_avatar)
            {
                Object.Destroy(m_avatar);
            }
            m_avatar = (GameObject)Object.Instantiate(prefab, base.transform.position, base.transform.rotation);
            m_avatar.transform.parent = base.transform;
            m_animControl             = m_avatar.GetComponent <BodyHeadAnim>();
            m_animControl2            = m_avatar.GetComponent <CharAnim2>();
            m_sound = m_avatar.GetComponent <CharSounds>();
            if (m_isOwnPlayer)
            {
                m_itemPopupGui = (PopupItemGUI)Object.FindObjectOfType(typeof(PopupItemGUI));
                m_quitGameGui  = (QuitGameGUI)Object.FindObjectOfType(typeof(QuitGameGUI));
            }
            else
            {
                base.gameObject.layer = m_avatar.layer;
            }
            if (null != m_animControl)
            {
                m_animControl.Init(m_isOwnPlayer);
            }
        }
    }
Beispiel #2
0
 private void LateUpdate()
 {
     if (Time.timeSinceLevelLoad < 1f)
     {
         return;
     }
     if (null != this.m_guimaster)
     {
         string clickedButtonName = this.m_guimaster.GetClickedButtonName();
         if (string.Empty != clickedButtonName)
         {
             if (this.IsActive(true))
             {
                 if (clickedButtonName.Length == 1)
                 {
                     try
                     {
                         this.ActivateGui((eActiveApp)int.Parse(clickedButtonName));
                     }
                     catch (Exception message)
                     {
                         Debug.Log(message);
                     }
                 }
                 else if (clickedButtonName.StartsWith("HELP_"))
                 {
                     this.m_helpText.text = LNG.Get(clickedButtonName + "_TEXT");
                 }
                 else if (null != this.m_guiCloseBtn && this.m_guiCloseBtn.name == clickedButtonName)
                 {
                     this.SetVisible(false);
                 }
                 else if (null != this.m_guiQuitBtn && this.m_guiQuitBtn.name == clickedButtonName)
                 {
                     QuitGameGUI quitGameGUI = (QuitGameGUI)UnityEngine.Object.FindObjectOfType(typeof(QuitGameGUI));
                     if (null != quitGameGUI)
                     {
                         quitGameGUI.ShowGui(true);
                     }
                 }
             }
             else if (null != this.m_guiComBtn && this.m_guiComBtn.name == clickedButtonName)
             {
                 this.SetVisible(true);
             }
         }
     }
 }
 private void Start()
 {
     m_guimaster   = (GUI3dMaster)Object.FindObjectOfType(typeof(GUI3dMaster));
     m_client      = (LidClient)Object.FindObjectOfType(typeof(LidClient));
     m_quitGameGui = (QuitGameGUI)Object.FindObjectOfType(typeof(QuitGameGUI));
 }