Example #1
0
    void OnShowRightChange()
    {
        var iter = m_dicRightItem.GetEnumerator();

        while (iter.MoveNext())
        {
            var            dic  = iter.Current;
            RightSkillItem 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();
            }
        }
    }
Example #2
0
    //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)
            {
                RightSkillItem item = trans.GetComponent <RightSkillItem>();
                if (item == null)
                {
                    item = trans.gameObject.AddComponent <RightSkillItem>();
                }
                if (i == 0)
                {
                    uint          common = skilldataManager.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 );
            }
        }
    }