Ejemplo n.º 1
0
 //-------------------------------------------------------------------------
 public override void release()
 {
     if (Bt != null)
     {
         Bt.close();
         Bt = null;
     }
 }
Ejemplo n.º 2
0
        //-------------------------------------------------------------------------
        void _onPropBtNameChanged(IProp prop, object param)
        {
            string bt_name = Def.mPropBtName.get();

            if (!string.IsNullOrEmpty(bt_name))
            {
                Bt = CellApp.Instance.createBt(bt_name, Entity);
            }
        }
Ejemplo n.º 3
0
        //-------------------------------------------------------------------------
        public override void release()
        {
            if (Bt != null)
            {
                Bt.close();
                Bt = null;
            }

            CoActorMirror = null;
            ActorAiConfig = null;
        }
Ejemplo n.º 4
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            TbDataPlayer = EbDataMgr.Instance.getData <TbDataPlayer>(Def.mPropPlayerTableId.get());

            Def.mPropLevel.OnChanged    = _onPropLevelChanged;
            Def.mPropNickName.OnChanged = _onPropNickNameChanged;
            Def.mPropIcon.OnChanged     = _onPropIcoChanged;

            CoActorMirror = Entity.getComponent <ClientActorMirror <DefActorMirror> >();
            CoActorMirror.initActor(Def.mPropPlayerTableId.get(), () =>
            {
                //CoActorMirror.SceneActorObj.setIcon(Def.mPropIcon.get());
                //CoActorMirror.SceneActorObj.setNickName(Def.mPropNickName.get(), Color.green);
            });
            CoActorMirror.updateMirrorActorInfo(Def.mPropNickName.get(), Def.mPropIcon.get());

            if (CoActorMirror.IsMe)
            {
                Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();
                var    co_app = et_app.getComponent <ClientApp <DefApp> >();
                Bt = co_app.createBt("BtPlayerMirror", Entity);
                //writeBlackboardPlayerOperateType(PlayerOperateType.None);
                writeBlackboardPosMoveTo(-10000, -10000);
                writeBlackboardLastPosMoveTo(-10000, 10000);
                writeBlackboardSelectEntity(null);
                writeBlackboardSkillItemId(0);
                writeBlackboardTaskId(0);
                writeBlackboardTaskAutoInfo(null);

                // 恢复任务自动执行
                //if (CoActorMirror.CoScene.TaskAutoInfo != null)
                //{
                //    writeBlackboardPlayerOperateType(PlayerOperateType.DoTask);
                //    writeBlackboardTaskAutoInfo(CoActorMirror.CoScene.TaskAutoInfo);
                //}
            }
        }