Beispiel #1
0
 public void ResetState()
 {
     if (m_nLoc == 0)
     {
         if (m_dataBase != null)
         {
             //DataManager.Manager<UIManager>().SetSpriteDynamicIcon(m_sprIcon, m_dataBase.iconPath, true, true);
             string iconName = UIManager.BuildCircleIconName(m_dataBase.iconPath);
             UIManager.GetTextureAsyn(iconName, ref m_curIconAsynSeed, () =>
             {
                 if (null != m_sprIcon)
                 {
                     m_sprIcon.mainTexture = null;
                 }
             }, m_sprIcon);
         }
         return;
     }
     if (m_dataBase == null)
     {
         SetItemState(RightLearnSkillItemState.NotSet);
         return;
     }
     else
     {
         SkillSettingState curState = DataManager.Manager <LearnSkillDataManager>().ShowState;
         uint skillID = 0;
         uint loc     = curState == SkillSettingState.StateOne ? m_nLoc : m_nLoc + 4;
         if (DataManager.Manager <LearnSkillDataManager>().TryGetLocationSkillId(curState, (int)loc, out skillID))
         {
             m_dataBase = GameTableManager.Instance.GetTableItem <SkillDatabase>(skillID, 1);
             SetItemState(RightLearnSkillItemState.SetRightNotSelect);
             ShowSkillIcon(true);
         }
         else
         {
             if (curState == SkillSettingState.StateOne)
             {
                 uint level = LearnDataManager.GetUnLockLevelByLoc(m_nLoc);
                 if (level > MainPlayerHelper.GetPlayerLevel())
                 {
                     SetItemState(RightLearnSkillItemState.Lock);
                 }
                 else
                 {
                     SetItemState(RightLearnSkillItemState.NotSet);
                 }
             }
             else
             {
                 SetItemState(RightLearnSkillItemState.NotSet);
             }
             ShowSkillIcon(false);
         }
     }
 }
Beispiel #2
0
 public void ResetState()
 {
     if (m_nLoc == 0)
     {
         if (m_dataBase != null)
         {
             UIManager.GetTextureAsyn(UIManager.GetIconName(m_dataBase.iconPath, true), ref iuiIconAtlas2, () =>
             {
                 if (m_sprIcon != null)
                 {
                     m_sprIcon.mainTexture = null;
                 }
             }, m_sprIcon, true);
         }
         return;
     }
     if (m_dataBase == null)
     {
         SetItemState(RightLearnSkillItemState.NotSet);
         return;
     }
     else
     {
         SkillSettingState curState = DataManager.Manager <ArenaSetSkillManager>().ShowState;
         uint skillID = 0;
         uint loc     = curState == SkillSettingState.StateOne ? m_nLoc : m_nLoc + 4;
         if (DataManager.Manager <ArenaSetSkillManager>().TryGetLocationSkillId(curState, (int)loc, out skillID))
         {
             m_dataBase = GameTableManager.Instance.GetTableItem <SkillDatabase>(skillID, 1);
             SetItemState(RightLearnSkillItemState.SetRightNotSelect);
             ShowSkillIcon(true);
         }
         else
         {
             if (curState == SkillSettingState.StateOne)
             {
                 uint level = LearnDataManager.GetUnLockLevelByLoc(m_nLoc);
                 if (level > MainPlayerHelper.GetPlayerLevel())
                 {
                     SetItemState(RightLearnSkillItemState.Lock);
                 }
                 else
                 {
                     SetItemState(RightLearnSkillItemState.NotSet);
                 }
             }
             else
             {
                 SetItemState(RightLearnSkillItemState.NotSet);
             }
             ShowSkillIcon(false);
         }
     }
 }
Beispiel #3
0
    public bool TryGetLocationSkillId(SkillSettingState state, int location, out uint skillid)
    {
        SortedDictionary <int, uint> tempDic = null;

        if (state == SkillSettingState.StateOne)
        {
            tempDic = stateOneDic;
        }
        else if (state == SkillSettingState.StateTwo)
        {
            tempDic = stateTwoDic;
        }
        return(tempDic.TryGetValue(location, out skillid));
    }
Beispiel #4
0
    public uint GetUnLockLevel()
    {
        SkillSettingState curState = DataManager.Manager <LearnSkillDataManager>().ShowState;
        uint loc = curState == SkillSettingState.StateOne ? m_nLoc : m_nLoc + 4;

        if (curState == SkillSettingState.StateOne)
        {
            uint level = LearnDataManager.GetUnLockLevelByLoc(m_nLoc);
            return(level);
        }
        else
        {
            return(0);
        }
    }
Beispiel #5
0
    void ShowSkillIcon(bool bShow)
    {
        if (m_sprIcon != null)
        {
            if (m_nLoc != 0)
            {
                m_sprIcon.gameObject.SetActive(bShow);
            }
            else
            {
                if (bShow)
                {
                    m_sprIcon.gameObject.SetActive(bShow);
                }
            }
        }
        SkillSettingState curState = DataManager.Manager <LearnSkillDataManager>().ShowState;
        uint skillID = 0;
        uint loc     = curState == SkillSettingState.StateOne ? m_nLoc : m_nLoc + 4;

        if (DataManager.Manager <LearnSkillDataManager>().TryGetLocationSkillId(curState, (int)loc, out skillID))
        {
            m_dataBase = GameTableManager.Instance.GetTableItem <SkillDatabase>(skillID, 1);
            string iconName = UIManager.BuildCircleIconName(m_dataBase.iconPath);
            UIManager.GetTextureAsyn(iconName, ref m_curIconAsynSeed, () =>
            {
                if (null != m_sprIcon)
                {
                    m_sprIcon.mainTexture = null;
                }
            }, m_sprIcon);
        }
        else
        {
            if (m_nLoc != 0)
            {
                if (null != m_sprIcon)
                {
                    //m_sprIcon.spriteName = "";
                    m_sprIcon.mainTexture = null;
                }
            }
        }
    }
Beispiel #6
0
    void ShowSkillIcon(bool bShow)
    {
        if (m_sprIcon != null)
        {
            if (m_nLoc != 0)
            {
                m_sprIcon.gameObject.SetActive(bShow);
            }
            else
            {
                if (bShow)
                {
                    m_sprIcon.gameObject.SetActive(bShow);
                }
            }
        }
        SkillSettingState curState = DataManager.Manager <ArenaSetSkillManager>().ShowState;
        uint skillID = 0;
        uint loc     = curState == SkillSettingState.StateOne ? m_nLoc : m_nLoc + 4;

        if (DataManager.Manager <ArenaSetSkillManager>().TryGetLocationSkillId(curState, (int)loc, out skillID))
        {
            m_dataBase = GameTableManager.Instance.GetTableItem <SkillDatabase>(skillID, 1);

            UIManager.GetTextureAsyn(UIManager.GetIconName(m_dataBase.iconPath, true), ref iuiIconAtlas, () =>
            {
                if (m_sprIcon != null)
                {
                    m_sprIcon.mainTexture = null;
                }
            }, m_sprIcon, true);
        }
        else
        {
            if (m_nLoc != 0)
            {
                m_sprIcon.mainTexture = null;
            }
        }
    }
Beispiel #7
0
    /// <summary>
    /// 1-8
    /// </summary>
    /// <param name="skillBtnIndex"></param>
    public void Init(int skillBtnIndex)
    {
        m_skillBtnIndex = skillBtnIndex;
        m_skillState    = SkillSettingState.StateOne;
        if (skillBtnIndex >= 5)
        {
            m_skillState = SkillSettingState.StateTwo;
        }

        if (m_skillBtnIndex == 0)//0 是普工  9是坐骑技能 10在未骑乘下是切换 骑乘下是坐骑技能
        {
        }
        if (m_skillBtnIndex == 10)
        {
            m_skillState = DataManager.Manager <LearnSkillDataManager>().CurState;
        }
        LearnSkillDataManager dm        = DataManager.Manager <LearnSkillDataManager>();
        List <uint>           levelList = dm.GetUnLockLevelList();

        if (levelList == null)
        {
            return;
        }
        int index = skillBtnIndex - 1;

        if (index >= 0)
        {
            if (index < levelList.Count)
            {
                uint lev = levelList[index];
                if (m_labelUnLockLevel != null)
                {
                    m_labelUnLockLevel.text = lev.ToString();
                }
            }
        }
    }
Beispiel #8
0
    public bool Create(List <GameCmd.SuitData> lstSuit, int nJob, int nSex, int nSize, GameObject parentObj, SkillSettingState eState = SkillSettingState.StateOne)
    {
        Engine.IRenderSystem rs = Engine.RareEngine.Instance().GetRenderSystem();
        if (rs == null)
        {
            Engine.Utility.Log.Error("获取RenderSystem失败!");
            return(false);
        }

        // 对象创建
        if (m_Root == null)
        {
            m_Root = new GameObject("RTObj");
            if (parentObj != null)
            {
                m_Root.transform.parent = parentObj.transform;
            }
        }

        //
        m_RenderObj = null;

        Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
        if (es == null)
        {
            return(false);
        }

        Client.EntityCreateData data = new Client.EntityCreateData();
        data.ID      = ++s_uPuppetID;
        data.strName = "";

        //int speed = player.GetProp((int)WorldObjProp.MoveSpeed);
        data.PropList = new EntityAttr[(int)PuppetProp.End - (int)EntityProp.Begin];
        int index = 0;

        data.PropList[index++] = new EntityAttr((int)PuppetProp.Job, nJob);
        data.PropList[index++] = new EntityAttr((int)PuppetProp.Sex, nSex);
        //data.PropList[index++] = new EntityAttr((int)EntityProp.BaseID, 0);
        //data.PropList[index++] = new EntityAttr((int)WorldObjProp.MoveSpeed, speed);
        data.eSkillState = eState;
        data.bViewModel  = true;
        // 处理时装外观数据
        EntityViewProp[] propList = new EntityViewProp[(int)Client.EquipPos.EquipPos_Max];
        index             = 0;
        propList[index++] = new EntityViewProp((int)Client.EquipPos.EquipPos_Body, 0);
        propList[index++] = new EntityViewProp((int)Client.EquipPos.EquipPos_Weapon, 0);

        if (lstSuit.Count > 0)
        {
            for (int i = 0; i < lstSuit.Count; ++i)
            {
                if (lstSuit[i] == null)
                {
                    continue;
                }

                int pos = GetPropPos((Client.EquipPos)lstSuit[i].suit_type, propList);
                if (pos >= 0)
                {
                    propList[pos] = new EntityViewProp((int)lstSuit[i].suit_type, (int)lstSuit[i].baseid);
                }
                else
                {
                    Client.EquipPos equipPos = (Client.EquipPos)lstSuit[i].suit_type;
                    propList[index++] = new EntityViewProp((int)equipPos, (int)lstSuit[i].baseid);
                }
            }
        }

        data.ViewList = propList;
        data.nLayer   = LayerMask.NameToLayer("ShowModel");

        m_PuppetObj = es.CreateEntity(Client.EntityType.EntityType_Puppet, data, true) as Client.IPuppet;
        if (m_PuppetObj == null)
        {
            Engine.Utility.Log.Error("创建Renderobj失败{0}!", "");
            return(false);
        }

        m_RenderObj = m_PuppetObj.renderObj;
        if (m_RenderObj == null)
        {
            return(false);
        }

        // 默认播放站立动作
        m_RenderObj.Play(Client.EntityAction.Stand);
        m_RenderObj.SetLayer((int)Engine.RenderLayer.ShowModel); // showModel

        // CreateCamera
        Camera cam = CreateCamera();

        m_RenderText = new RenderTexture(nSize, nSize, 24, RenderTextureFormat.ARGB32);
        if (m_RenderText == null)
        {
            return(false);
        }
        cam.targetTexture = m_RenderText;

        // 对象挂在父节点上
        if (m_Root != null)
        {
            m_RenderObj.GetNode().GetTransForm().parent = m_Root.transform;
            m_Camera.transform.parent = m_Root.transform;
        }

        return(true);
    }
Beispiel #9
0
    /// <summary>
    /// 设置切换技能
    /// </summary>
    void SetChangeStateSkill()
    {
        Client.IPlayer    player    = ClientGlobal.Instance().MainPlayer;
        int               level     = player.GetProp((int)CreatureProp.Level);
        int               job       = player.GetProp((int)PlayerProp.Job);
        string            secondKey = job.ToString();
        SkillSettingState curState  = DataManager.Manager <LearnSkillDataManager>().CurState;

        if (curState == SkillSettingState.StateTwo)
        {
            secondKey = (10 + job).ToString();
        }
        m_skillid = GameTableManager.Instance.GetGlobalConfig <uint>("ChangeStateSkillID", secondKey);
        int needLevel = GameTableManager.Instance.GetGlobalConfig <int>("ChangeStateLevel");

        if (level < needLevel)
        {
            ResetBtn();
            //skillIcon.spriteName = "icon_lock";
            skillIcon.mainTexture = null;
            if (skillName != null)
            {
                skillName.text = needLevel.ToString();
            }
            SetBtnEnable(false);
            SetLongPressEvent(false);
            return;
        }
        else
        {
            if (skillBtn != null)
            {
                ResetBtn();
            }
            table.SkillDatabase db = GameTableManager.Instance.GetTableItem <table.SkillDatabase>((uint)m_skillid, 1);
            if (db != null)
            {
                UIManager.GetTextureAsyn(DataManager.Manager <UIManager>().GetResIDByFileName(false, db.iconPath, true), ref iuiIconAtlas, () =>
                {
                    if (null != skillIcon)
                    {
                        skillIcon.mainTexture = null;
                    }
                }, skillIcon, false);
            }
        }
        if (skillIcon != null)
        {
            skillIcon.width  = overlay.width;
            skillIcon.height = overlay.height;
            skillIcon.alpha  = 1f;
        }

        if (skillBtn != null)
        {
            SetLongPressEvent(true);
            SetBtnEnable(true);
        }

        RunCD();
    }
Beispiel #10
0
 public void Initialize()
 {
     RegisterEvent(true);
     curState  = SkillSettingState.StateOne;
     showState = SkillSettingState.StateOne;
 }