Exemplo n.º 1
0
    private bool PlayAni(ObjectBase obj, ArrayList param)
    {
        if (param == null || param.Count < 2)
        {
            return(false);
        }

        Player player = obj as Player;

        if (player == null)
        {
            return(false);
        }

        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;

        if (System.Convert.ToInt32(param[0]) == 0)
        {
            action.AnimName = "Base Layer." + (param[1] as string);
        }
        else
        {
            action.AnimName = "Base Layer." + player.CombineAnimname("%" + param[1] as string);
        }

        player.GetStateController().DoAction(action);

        WindowManager.Instance.CloseUI("chat");

        return(true);
    }
Exemplo n.º 2
0
    static public void PlayAni(uint objId, string aniName)
    {
        BaseScene scn = SceneManager.Instance.GetCurScene();

        if (scn == null)
        {
            return;
        }

        ObjectBase obj = scn.FindObject(objId);

        if (obj == null)
        {
            return;
        }

        VisualObject vObj = obj as VisualObject;

        if (vObj == null)
        {
            return;
        }

        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;

        action.AnimName = aniName;

        vObj.GetStateController().DoAction(action);
        return;
    }
Exemplo n.º 3
0
    public void PlayLeisureAnimation()
    {
        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;

        action.AnimName = CombineAnimname("%xiuxian");
        GetStateController().DoAction(action);

        //GetStateController().DoAction(AnimActionFactory.E_Type.PlayIdleAnim);
    }
Exemplo n.º 4
0
    public static AnimAction Create(E_Type type)
    {
        AnimAction action;
        int        index = (int)type;

        if (m_UnusedActions[index].Count > 0)
        {
            action = m_UnusedActions[index].Dequeue();
        }
        else
        {
            switch (type)
            {
            case E_Type.Idle:
                action = new AnimActionIdle();
                break;

            case E_Type.PlayAnim:
                action = new AnimActionPlayAnim();
                break;

            case E_Type.Move:
                action = new AnimActionMove();
                break;

            case E_Type.UseSkill:
                action = new AnimActionUseSkill();
                break;

            case E_Type.Death:
                action = new AnimActionDeath();
                break;

            case E_Type.Hurt:
                action = new AnimActionHurt();
                break;

            default:
                Debug.LogError("no AgentAction to create");
                return(null);
            }
        }
        action.Reset();
        action.SetActive();
        return(action);
    }
Exemplo n.º 5
0
    override public bool Init(BaseSceneInitParam param)
    {
        mSubRes = DataManager.SceneTable[param.res_id] as Scene_QualifyingSceneTableItem;
        if (mSubRes == null)
        {
            return(false);
        }

        if (!base.Init(param))
        {
            return(false);
        }

        mResult             = -1;
        mAnimParam          = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;
        mAnimParam.AnimName = "Base Layer.huanhu";

        return(true);
    }
Exemplo n.º 6
0
    private void PlayBornAnimation()
    {
        if (mRes == null)
        {
            return;
        }

        if (string.IsNullOrEmpty(mRes.bornAni) || mRes.bornAniTime == uint.MaxValue)
        {
            return;
        }

        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;


        action.AnimName = CombineAnimname("%" + mRes.bornAni);

        GetStateController().DoAction(action);

        mBornAniTime = (int)mRes.bornAniTime;
    }
Exemplo n.º 7
0
    override public bool Init(BaseSceneInitParam param)
    {
        mSubRes = DataManager.SceneTable[param.res_id] as Scene_TDSceneTableItem;
        if (mSubRes == null)
        {
            return(false);
        }

        if (!base.Init(param))
        {
            return(false);
        }

        mLife             = GameConfig.TDLifeCount;
        mBalanceComponent = new TDBalanceComponent(this);

        mAnimParam          = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;
        mAnimParam.AnimName = "Base Layer.huanhu";

        return(true);
    }