コード例 #1
0
        public Role(int id)
        {
            table = Table <tRole> .Find(id);

            Log.ErrorIf(table == null, $"找不到 RoleTable :{id}");
            this.id = id;
            guid    = Funcs.NewGuid();
            skinId  = table.skinIds[0];

            skin = Table <tSkin> .Find(skinId);

            avatar = new Avatar(SceneManager.roleRoot, skin.skeleton, skin.skin, AfterRoleLoadFinish);
            avatar.gameObject.name = id + "_" + guid;

            act = new ActController(this);

            move = new MoveController(avatar.gameObject.transform);
            move.onMoveFinished = OnMoveFinished;
            move.onMoveStart    = OnMoveStart;

            //加载动画
            AssetMgr.Instance.LoadAsync(skin.animDir + "/Walk.anim", (anim) => {
                animWalk = anim as AnimationClip;
            });
            AssetMgr.Instance.LoadAsync(skin.animDir + "/Stand.anim", (anim) => {
                animStand = anim as AnimationClip;
                AfterRoleLoadFinish();
            });
            LoadAnimationClips(act.actCombos);
        }
コード例 #2
0
ファイル: AnimationEventAdapter.cs プロジェクト: meamin9/cat
 public void SetActListener(ActController act)
 {
     this.mActCtrl = act;
 }