Exemple #1
0
 public void UpdateFormationGameObject()
 {
     Des3DGameObject();
     Init2DHeros();
     Init3DHeros();
     UI_MainHome.GetInst().ShowMianHeroData();
 }
Exemple #2
0
 protected override void OnClickBackBtn()
 {
     UI_HomeControler.Inst.ReMoveUI(gameObject);
     if (GuideManager.GetInstance().isGuideUser&& GuideManager.GetInstance().IsContentGuideID(100301) == false && GuideManager.GetInstance().GetBackCount(100204) == true)
     {
         UI_MainHome.GetInst().InitGuideFightBtn(100301);
     }
 }
Exemple #3
0
    /// <summary>
    /// OK = 1; // 成功
    /// ERROR = 2; // 失败
    /// INVALID = 3; // 名称不合法
    /// DUPLICATED = 4; // 重名
    /// NO_ITEM = 5; // 没有道具
    /// OVERLEN = 6; // 角色名过长
    /// SHORTLEN = 7; // 角色名过短
    /// ERRORCHAR = 8; // 特殊符号
    /// HAVESPACE = 9; // 有空格
    /// </summary>
    private void OnNameCHange(GameEvent ge)
    {
        byte error = (byte)ge.data;

        switch (error)
        {
        case 1:
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("nickname_word5"), m_InputName.gameObject.transform);
            ObjectSelf.GetInstance().Name = m_NickName;
            GameEventDispatcher.Inst.dispatchEvent(GameEventID.Net_MCHumanDetailAttribute_Name);

            // 新手引导
            UI_MainHome.GetInst().ShowGuideRecruit();

            UI_HomeControler.Inst.ReMoveUI(gameObject);

            break;

        case 2:
            InterfaceControler.GetInst().AddMsgBox("修改昵称失败", this.transform);
            m_InputName.text = string.Empty;
            break;

        case 3:
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("nickname_word1"), this.transform);
            m_InputName.text = string.Empty;
            break;

        case 8:
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("nickname_word2"), this.transform);
            m_InputName.text = string.Empty;
            break;

        case 9:
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("nickname_word6"), this.transform);
            m_InputName.text = string.Empty;
            break;

        case 4:
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("nickname_word3"), this.transform);
            m_InputName.text = string.Empty;
            break;

        case 6:
            InterfaceControler.GetInst().AddMsgBox("角色名过长,请重新输入", this.transform);
            m_InputName.text = string.Empty;
            break;

        case 7:
            InterfaceControler.GetInst().AddMsgBox("角色名过短,请重新输入", this.transform);
            m_InputName.text = string.Empty;
            break;

        default:
            break;
        }
    }
Exemple #4
0
 public void OnDrag(PointerEventData eventData)
 {
     //Debug.Log(eventData.pointerDrag.name);
     if (eventData.delta.x > 0.0f)
     {
         //print("right");
         UI_MainHome.GetInst().OnShowTool();
     }
     if (eventData.delta.x < 0.0f)
     {
         //print("left");
         UI_MainHome.GetInst().OnBackTool();
     }
 }
Exemple #5
0
    void LateUpdate()
    {
        //Quaternion rotation = Quaternion.Euler(0, x, 0);
        //transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * 2);
        //transform.rotation = rotation;

        if (isRotation)
        {
            curTime += Time.deltaTime;
            if (curTime >= allTime)
            {
                curTime    = 0.0f;
                isRotation = false;
            }

            if (UI_MainHome.GetInst() != null)
            {
                UI_MainHome.GetInst().UpdateMainHeroInfo();
            }
        }
    }
Exemple #6
0
    void Update()
    {
#if UNITY_STANDALONE_WIN
        if (Input.GetMouseButton(0))
        {
            if (EventSystem.current.IsPointerOverGameObject())
            {
                return;
            }

            temp_x = Input.GetAxis("Mouse X") * -1;
            if (temp_x > 0)//限制摄像机在X轴的旋转
            {
                if (x + temp_x * xSpeed < curXMax)
                {
                    x += temp_x * xSpeed;
                }
                else
                {
                    x = curXMax;
                }
            }
            else
            {
                if (x + temp_x * xSpeed > curXMin)
                {
                    x += temp_x * xSpeed;
                }
                else
                {
                    x = curXMin;
                }
            }

            if (UI_MainHome.GetInst() != null)
            {
                UI_MainHome.GetInst().UpdateMainHeroInfo();
            }
        }
        if (Input.GetMouseButtonUp(0))
        {
            isRotation = true;
        }
        Quaternion rotation = Quaternion.Euler(0, x, 0);
        transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * 2);
#endif

#if UNITY_IPHONE || UNITY_ANDROID
        if (Input.touchCount == 1)
        {
            if (EventSystem.current.IsPointerOverGameObject())
            {
                return;
            }

            if (Input.GetTouch(0).phase == TouchPhase.Moved)
            {
                temp_x = Input.GetAxis("Mouse X") * -1;
                if (temp_x > 0)//限制摄像机在X轴的旋转
                {
                    if (x + temp_x * xSpeed < curXMax)
                    {
                        x += temp_x * xSpeed;
                    }
                    else
                    {
                        x = curXMax;
                    }
                }
                else
                {
                    if (x + temp_x * xSpeed > curXMin)
                    {
                        x += temp_x * xSpeed;
                    }
                    else
                    {
                        x = curXMin;
                    }
                }

                if (UI_MainHome.GetInst() != null)
                {
                    UI_MainHome.GetInst().UpdateMainHeroInfo();
                }
            }
        }
        if (Input.GetMouseButtonUp(0))
        {
            isRotation = true;
        }

        Quaternion rotation = Quaternion.Euler(0, x, 0);
        transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * 2);
#endif
    }