Update GameActor.cs

This commit is contained in:
ALEXTANG
2022-09-19 19:59:04 +08:00
parent 87e502ed21
commit 752cf4bad6

View File

@@ -10,6 +10,7 @@ namespace TEngine.Runtime.Actor
public abstract partial class GameActor public abstract partial class GameActor
{ {
#region Propreties #region Propreties
public uint ActorId { get; set; } public uint ActorId { get; set; }
public bool IsCreated { get; set; } public bool IsCreated { get; set; }
@@ -51,6 +52,7 @@ namespace TEngine.Runtime.Actor
{ {
_visibleTime = Time.time; _visibleTime = Time.time;
} }
Event.SendEvent(ActorEventType.ModelVisibleChange, _visible); Event.SendEvent(ActorEventType.ModelVisibleChange, _visible);
} }
} }
@@ -74,9 +76,11 @@ namespace TEngine.Runtime.Actor
{ {
return "UNNAMED"; return "UNNAMED";
} }
#endregion #endregion
#region Transform #region Transform
public Transform transform public Transform transform
{ {
get get
@@ -175,9 +179,11 @@ namespace TEngine.Runtime.Actor
} }
} }
} }
#endregion #endregion
#region Init #region Init
internal void Init() internal void Init()
{ {
Awake(); Awake();
@@ -188,17 +194,14 @@ namespace TEngine.Runtime.Actor
public virtual void Awake() public virtual void Awake()
{ {
} }
public virtual void OnInit() public virtual void OnInit()
{ {
} }
public virtual void AfterInit() public virtual void AfterInit()
{ {
} }
protected virtual GameObject CreateGameObject() protected virtual GameObject CreateGameObject()
@@ -216,10 +219,10 @@ namespace TEngine.Runtime.Actor
ActorManager.Instance.BindGameActorGo(this, _gameObject); ActorManager.Instance.BindGameActorGo(this, _gameObject);
} }
InitExt(); InitExt();
} }
#endregion #endregion
#region Methods #region Methods
@@ -244,11 +247,13 @@ namespace TEngine.Runtime.Actor
IsDestroyed = true; IsDestroyed = true;
_isDestroying = false; _isDestroying = false;
} }
#endregion #endregion
#region Expand #region Expand
#region Base #region Base
public static bool operator ==(GameActor obj1, GameActor obj2) public static bool operator ==(GameActor obj1, GameActor obj2)
{ {
if (ReferenceEquals(obj1, obj2)) if (ReferenceEquals(obj1, obj2))
@@ -282,6 +287,7 @@ namespace TEngine.Runtime.Actor
{ {
return base.GetHashCode(); return base.GetHashCode();
} }
#endregion #endregion
#endregion #endregion