Beispiel #1
0
 private void InternalDetachGameObject()
 {
     OnDetachGameObject();
     GameObjectEx.Uninit();
     PoolMgr.singleton.ReleaseCsharpObject(GameObjectEx);
     GameObjectEx = null;
 }
 private void InternalAttachGameObject(GameObjectEx go)
 {
     GameObjectEx = go;
     Animator     = GameObjectEx.gameObject.GetComponent <Animator>();
     UnityObject.DontDestroyOnLoad(GameObjectEx.gameObject);
     OnAttachGameObject(go);
 }
Beispiel #3
0
 /// <summary>
 /// Entity附加GameObject;
 /// </summary>
 /// <param name="go"></param>
 protected virtual void OnAttachGoEx(GameObjectEx go)
 {
     gameObjectEx = go;
     if (_entityLoadFinishHandler != null)
     {
         _entityLoadFinishHandler(this, gameObjectEx.gameObject);
     }
 }
Beispiel #4
0
        /// <summary>
        /// 初始化Entity;
        /// </summary>
        /// <param name="entityId"></param>
        /// <param name="uid"></param>
        /// <param name="name"></param>
        public void Initialize(int entityId, ulong uid, string name)
        {
            UID          = uid;
            EntityName   = name;
            EntityId     = entityId;
            Enable       = true;
            GameObjectEx = PoolMgr.singleton.GetCsharpObject <GameObjectEx>();

            InternalInitialize();
            GameObjectEx.AddLoadFinishHandler((goex) =>
            {
                InternalAttachGameObject(goex);
                _entityLoadFinishHandler?.Invoke(this, GameObjectEx.gameObject);
            });
            GameObjectEx.Init(this, AssetPath);
        }
Beispiel #5
0
 protected override void OnAttachGameObject(GameObjectEx goEx)
 {
     base.OnAttachGameObject(goEx);
     _stateMachine = StateMachineMgr.singleton.CreateStateMachine(Entity);
 }
Beispiel #6
0
 /// <summary>
 /// Component附加GameObject;
 /// </summary>
 /// <param name="go"></param>
 protected virtual void OnAttachGoEx(GameObjectEx goEx)
 {
 }
Beispiel #7
0
 private void InternalAttachGameObject(GameObjectEx go)
 {
     GameObjectEx = go;
     Animator     = GameObjectEx.gameObject.GetComponent <Animator>();
     OnAttachGameObject(go);
 }
Beispiel #8
0
 /// <summary>
 /// Entity附加GameObject;
 /// </summary>
 /// <param name="go"></param>
 protected virtual void OnAttachGameObject(GameObjectEx go)
 {
 }