Beispiel #1
0
 public void Update(LuaTable table)
 {
     id             = table["id"].ToString().ToInt32();
     formationData  = FormationData.GetFormationData(id);
     level          = table["level"].ToString().ToInt32();
     formationState = (FormationState)table["formationState"].ToString().ToInt32();
 }
        public void SetState(FormationState state)
        {
            _state = state;
            if (_state == FormationState.InUse)
            {
                bgImage.SetSprite(_selectBg);
            }
            else
            {
                bgImage.SetSprite(_normalBg);
            }
            bool isLock = _state == FormationState.Locked;

            if (panel != null)
            {
                UIUtil.SetGray(panel, isLock);
            }
            if (levelRoot != null)
            {
                levelRoot.SetActive(!isLock);
            }
            if (lockGO != null)
            {
                lockGO.SetActive(isLock);
            }
        }
Beispiel #3
0
 public FormationInfo(int formationDataID, int level, FormationState formationState = FormationState.Locked)
 {
     id                  = formationDataID;
     formationData       = FormationData.GetFormationData(formationDataID);
     this.level          = level;
     this.formationState = formationState;
 }
    /// <summary>
    /// 返回状态按钮文字
    /// </summary>
    /// <param name="state"></param>
    /// <returns></returns>
    private string StateBtnStr(FormationState state)
    {
        switch (state)
        {
        case FormationState.Upstate:
            return("上 阵");

        case FormationState.DownState:
            return("下 阵");

        case FormationState.ChangeState:
            return("更 换");

        case FormationState.MoveState:
            return("移 动");

        default:
            return("");
        }
    }
Beispiel #5
0
 //显示是否上阵
 void InitIsUpFront()
 {
     if (selfTransform.FindChild("Parent/Box_Eff/HeroFrameLight01").gameObject != null)
     {
         SelectBox = selfTransform.FindChild("Parent/Box_Eff/HeroFrameLight01").gameObject;
     }
     if (selfTransform.FindChild("Parent/DownFrontImg").gameObject != null)
     {
         DownFeontImg = selfTransform.FindChild("Parent/DownFrontImg").gameObject;
     }
     if (selfTransform.FindChild("Parent/YetUpFrontImg").gameObject != null)
     {
         YetUpFrontImg = selfTransform.FindChild("Parent/YetUpFrontImg").gameObject;
     }
     Formationstate = FormationState.Null;
     YetUpFrontImg.SetActive(false);
     DownFeontImg.SetActive(false);
     SelectBox.SetActive(false);
     for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
     {
         int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
         if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
         {
             continue;
         }
         X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
         if (pMemberGuiD.GUID_value == HeroObject.GetGuid().GUID_value)
         {
             Formationstate = FormationState.Upstate;
             YetUpFrontImg.SetActive(true);
             if (UI_Form.GetInst().GetGuid() != null && UI_Form.GetInst().GetGuid().GUID_value == HeroObject.GetGuid().GUID_value)
             {
                 Formationstate = FormationState.DownState;
                 YetUpFrontImg.SetActive(false);
                 DownFeontImg.SetActive(true);
                 SelectBox.SetActive(true);
             }
         }
     }
 }
 public void SetInfo(FormationInfo formationInfo, FormationState state)
 {
     _formationInfo = formationInfo;
     _state         = state;
     Refresh();
 }
Beispiel #7
0
 private static void PrintFormationState(StringBuilder sb, string indention, FormationState formationState)
 {
     sb.AppendLine(indention + "[FormationState]");
     sb.AppendLine(indention + Indention + "[Unk01: " + formationState.Unk01 + "]");
     sb.AppendLine(indention + Indention + "[Unk02: " + formationState.Unk02 + "]");
     sb.AppendLine(indention + Indention + "[Unk03: " + formationState.Unk03 + "]");
 }
Beispiel #8
0
 public void Update(LineupProtoData data)
 {
     this.level          = data.lv;
     this.formationState = FormationState.NotInUse;
 }
    /// <summary>
    /// 显示StateBtn 文字状态
    /// </summary>
    private void ShowBtnState()
    {
        m_State = FormationState.Upstate;

        int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();

        if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
        {
            return;
        }

        if (UI_SelectHeroMgr.Inst.GetCard() == null)
        {
            for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
            {
                X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
                //移动状态
                if (pMemberGuiD.GUID_value == m_Card.GetGuid().GUID_value)
                {
                    m_State = FormationState.MoveState;
                    break;
                }
            }
        }
        else
        {
            //下阵状态
            if (UI_SelectHeroMgr.Inst.GetCard().GetGuid().GUID_value == m_Card.GetGuid().GUID_value)
            {
                m_State = FormationState.DownState;
            }
            else
            {
                for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
                {
                    X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
                    //移动状态
                    if (pMemberGuiD.GUID_value == m_Card.GetGuid().GUID_value)
                    {
                        m_State = FormationState.MoveState;
                        break;
                    }
                    else//更换状态
                    {
                        m_State = FormationState.ChangeState;
                    }
                }
            }
        }

        m_StateBtnTxt.text = StateBtnStr(m_State);

        m_StateBtn.interactable = true;
        m_StateBtn.GetComponent <Image>().color = Color.white;
/*        m_StateBtn.gameObject.SetActive(true);*/
        if (m_State == FormationState.MoveState || m_State == FormationState.DownState)
        {
            m_YetUpStateOBJ.SetActive(true);
        }
        else
        {
            m_YetUpStateOBJ.SetActive(false);
        }

        if (UI_SelectHeroMgr.Inst.SelectPos == 0)//选择位置是前排
        {
            if (UI_SelectHeroMgr.Inst.GetCard() != null &&
                UI_SelectHeroMgr.Inst.GetCard().GetHeroRow().getQosition() == 1)//该位置英雄为防御型
            {
                if (m_State == FormationState.MoveState)
                {
                    int count = UI_FormMgr.Inst.GetBackHeroGuids().Count;
                    for (int i = 0; i < count; i++)
                    {
                        if (UI_FormMgr.Inst.GetBackHeroGuids().Contains(m_Card.GetGuid().GUID_value))//当前英雄站在后排
                        {
                            /*m_StateBtn.gameObject.SetActive(false);*/
                            m_StateBtn.interactable = false;
                            m_StateBtn.GetComponent <Image>().color = Color.gray;
                        }
                    }
                }
            }
        }
        else
        {
            if (m_HeroT.getQosition() == 1)
            {
                /* m_StateBtn.gameObject.SetActive(false);*/
                m_StateBtn.interactable = false;
                m_StateBtn.GetComponent <Image>().color = Color.gray;
            }
        }
    }