Пример #1
0
    public void SwitchViewMode(CardViewMode newMode)
    {
        if (curViewMode == newMode)
        {
            return;
        }
        switch (newMode)
        {
        case CardViewMode.Normal:
            ResetCard();
            break;

        case CardViewMode.HoldCard:
            if (curViewMode == CardViewMode.Normal)
            {
                oriPos    = gameObject.transform.position;
                oriParent = gameObject.transform.parent;
            }
            iTween.Stop(gameObject);
            holding = true;
            WindowsUtil.SwitchLayer(gameObject, UILayer.NoticeLayer);
            break;

        case CardViewMode.SelectTarget:
            holding = false;
            iTween.MoveTo(gameObject, displayPosition, 0.5f);
            break;
        }
        curViewMode = newMode;
    }