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