Esempio n. 1
0
 /** 点击事件 */
 public override void buttonEventBase(GameObject gameObj)
 {
     base.buttonEventBase(gameObj);
     if (gameObj.name == "close")
     {
         finishWindow();
     }
     else
     {
         GameObject content = getContent(currentTapIndex);
         if (currentTapIndex == TAP_ATTR_CONTENT)
         {
             MountsAttrContent mac = content.GetComponent <MountsAttrContent> ();
             mac.buttonEventBase(gameObj);
         }
         else if (currentTapIndex == TAP_STORE_CONTENT)
         {
             MountStoreContent msc = content.GetComponent <MountStoreContent> ();
             msc.buttonEventBase(gameObj);
         }
         else if (currentTapIndex == TAP_SKILL_CONTENT)
         {
             MountLifeSkillContent mlsc = content.GetComponent <MountLifeSkillContent> ();
             mlsc.buttonEventBase(gameObj);
         }
     }
 }
Esempio n. 2
0
    /** 初始化容器 */
    private void initContent(int tapIndex)
    {
        // 消耗大就删除掉老节点
        //		GameObject lastPoint = contents [this.currentTapIndex];
        //		if(lastPoint.transform.childCount>0)
        //			Utils.RemoveAllChild (lastPoint.transform);
        resetContentsActive();
        GameObject content = getContent(tapIndex);

        switch (tapIndex)
        {
        case TAP_ATTR_CONTENT:
            MountsAttrContent mac = content.GetComponent <MountsAttrContent> ();
            mac.init(this);
            break;

        case TAP_STORE_CONTENT:
            MountStoreContent msc = content.GetComponent <MountStoreContent> ();
            msc.init(this, buttonType);
            break;

        case TAP_SKILL_CONTENT:
            MountLifeSkillContent mlsc = content.GetComponent <MountLifeSkillContent> ();
            mlsc.init(this);
            break;
        }
    }
Esempio n. 3
0
    /** 更新节点容器 */
    public void UpdateContent()
    {
        GameObject content = getContent(currentTapIndex);

        if (currentTapIndex == TAP_ATTR_CONTENT)
        {
            MountsAttrContent mac = content.GetComponent <MountsAttrContent> ();
            mac.UpdateUI();
        }
        else if (currentTapIndex == TAP_STORE_CONTENT)
        {
            MountStoreContent msc = content.GetComponent <MountStoreContent> ();
            msc.UpdateUI();
        }
        else if (currentTapIndex == TAP_SKILL_CONTENT)
        {
            MountLifeSkillContent mlsc = content.GetComponent <MountLifeSkillContent> ();
            mlsc.UpdateUI();
        }
    }