Пример #1
0
    public void UpdateItemFromAction(CActionItem action)
    {
        //断开和原来的Action的联系
        if (currActionItem != null && currActionItem != action)
        {
            currActionItem.RemoveRefrence(this);
        }

        currActionItem = action;

        if (currActionItem == null)
        {
            ClearAction();
            return;
        }

        //EnableDrag();

        //绑定逻辑和ui
        currActionItem.AddReference(this, false);

        SetIcon(currActionItem.GetIconName());

        // 更新cooldown [3/15/2012 Ivan]
        currActionItem.UpdateCoolDown();

        if (action.GetNum() > 1)
        {
            SetCornerChar(CORNER_NUMBER_POS.ANP_BOTRIGHT, action.GetNum().ToString());
        }
    }
 internal string GetIcon()
 {
     if (currAction != null)
     {
         return(currAction.GetIconName());
     }
     return("");
 }