Esempio n. 1
0
    //void InitSetting()
    //{
    //    skilldataManager.IsSettingPanel = true;
    //    m_widget_skill_setting_area.gameObject.SetActive(true);
    //    SetAllSkillSettingItem();
    //    ResetChange();
    //}


    /*
     * void onClick_Btn_LevelUp_Btn(GameObject caster)
     * {
     *  int playerLevel = skilldataManager.GetPlayerLevel();
     *  uint dbLevel = CurDataBase.wdLevel + 1;
     *  SkillDatabase db = GameTableManager.Instance.GetTableItem<SkillDatabase>(CurDataBase.wdID, (int)dbLevel);
     *  if (db != null)
     *  {
     *      if (playerLevel < db.dwNeedLevel)
     *      {
     *          TipsManager.Instance.ShowTips(LocalTextType.Skill_Commond_renwudengjibuzubunnegshengji);
     *          return;
     *      }
     *  }
     *  DataManager.Manager<LearnSkillDataManager>().LearnSkill(CurDataBase.wdID, dbLevel);
     * }
     */

    //void SetItemLocation(UnityEngine.GameObject go , string parentName)
    //{
    //    if ( string.IsNullOrEmpty( parentName ) )
    //        return;
    //    Transform trans = m_widget_SkillContainer.transform.Find( parentName );
    //    if ( trans != null )
    //    {
    //        NGUITools.DestroyChildren( trans );
    //        if ( go != null )
    //        {
    //            go.transform.parent = trans;
    //            go.transform.localPosition = Vector3.zero;
    //            go.transform.localScale = Vector3.one;
    //            go.transform.localRotation = Quaternion.identity;
    //        }

    //    }
    //}
    void ClearSettingItem()
    {
        int count = m_widget_SkillContainer.transform.childCount;

        for (int i = 0; i < count; i++)
        {
            string    parentName = "skill_" + i;
            Transform trans      = m_widget_SkillContainer.transform.Find(parentName);
            if (trans != null)
            {
                ArenaRightSkillItem item = trans.GetComponent <ArenaRightSkillItem>();
                if (item == null)
                {
                    item = trans.gameObject.AddComponent <ArenaRightSkillItem>();
                }
                if (i == 0)
                {
                    uint          common = DataManager.Manager <LearnSkillDataManager>().GetCommonSkillIDByJob();
                    SkillDatabase db     = GameTableManager.Instance.GetTableItem <SkillDatabase>(common, 1);
                    item.InitItem(db);
                }
                else
                {
                    item.ResetState();
                    //  item.InitItem(null);
                }

                if (!m_dicRightItem.ContainsKey(i))
                {
                    m_dicRightItem.Add(i, item);
                }
                //NGUITools.DestroyChildren( trans );
            }
        }
    }
Esempio n. 2
0
    protected override void OnPanelBaseDestory()
    {
        base.OnPanelBaseDestory();

        SortedDictionary <uint, ArenaLeftSkillItem> .Enumerator etr = m_dicLeftItem.GetEnumerator();
        while (etr.MoveNext())
        {
            ArenaLeftSkillItem arenaLeftSkillItem = etr.Current.Value;
            arenaLeftSkillItem.Release();
        }

        Dictionary <int, ArenaRightSkillItem> .Enumerator etr2 = m_dicRightItem.GetEnumerator();
        while (etr2.MoveNext())
        {
            ArenaRightSkillItem arenaRightSkillItem = etr2.Current.Value;
            arenaRightSkillItem.Release();
        }
    }
Esempio n. 3
0
    void OnRightItemClick(GameObject go)
    {
        int  loc   = skilldataManager.GetLocation(go.name);
        uint level = skilldataManager.GetUnLockLevelByLoc((uint)loc);

        if (level > MainPlayerHelper.GetPlayerLevel())
        {
            return;
        }
        if (!BRightChange && !BLeftChange)
        {
            BLeftChange = true;
        }
        ArenaRightSkillItem rightItem = go.GetComponent <ArenaRightSkillItem>();

        if (rightItem != null)
        {
            m_nLoction = loc;
            if (BRightChange)
            {
                if (m_uWillSetSkillID == 0)
                {
                    TipsManager.Instance.ShowTips(LocalTextType.Skill_Commond_qingxuanzhongyigekeyitihuandejineng);
                    return;
                }
                BRightChange = false;

                SendSetSkillMessage();
            }
            if (BLeftChange)
            {
                rightItem.SetItemState(RightLearnSkillItemState.SetRightSelect);
            }
        }
        //string name = go.name;
        //int index = -1;
        //int len = name.Length - 1;
        //string indexStr = name[len].ToString();
        //if ( int.TryParse( indexStr , out index ) )
        //{

        //}
    }
Esempio n. 4
0
 void OnShowRightChange()
 {
     foreach (var dic in m_dicRightItem)
     {
         ArenaRightSkillItem item = dic.Value;
         if (m_bRightChange)
         {
             uint level = item.GetUnLockLevel();
             if (level > MainPlayerHelper.GetPlayerLevel())
             {
                 item.SetItemState(RightLearnSkillItemState.Lock);
             }
             else
             {
                 item.SetItemState(RightLearnSkillItemState.SetRightCanChange);
             }
         }
         else
         {
             item.ResetState();
         }
     }
 }