Class Actor
Actor take actions in the game. Most of game-related things inherits actor.
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
Mirror.NetworkBehaviour
Actor
Assembly: Dew.Core.dll
Syntax
[SelectionBase]
[DewResourceLink(ResourceLinkBy.Type)]
public class Actor : DewNetworkBehaviour, ILogicUpdate, ICleanup, ICustomDestroyRoutine
Fields
ActorEvent_OnAbilityInstanceBeforePrepare
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoAbilityInstance> ActorEvent_OnAbilityInstanceBeforePrepare
Field Value
ActorEvent_OnAbilityInstanceCreated
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoAbilityInstance> ActorEvent_OnAbilityInstanceCreated
Field Value
ActorEvent_OnApplyElemental
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoApplyElemental> ActorEvent_OnApplyElemental
Field Value
ActorEvent_OnAttackEffectTriggered
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoAttackEffect> ActorEvent_OnAttackEffectTriggered
Field Value
ActorEvent_OnAttackHit
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoAttackHit> ActorEvent_OnAttackHit
Field Value
ActorEvent_OnDealDamage
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoDamage> ActorEvent_OnDealDamage
Field Value
ActorEvent_OnDoHeal
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoHeal> ActorEvent_OnDoHeal
Field Value
ActorEvent_OnDoManaHeal
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoHeal> ActorEvent_OnDoManaHeal
Field Value
ActorEvent_OnGiveShield
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoShield> ActorEvent_OnGiveShield
Field Value
ActorEvent_OnKill
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoKill> ActorEvent_OnKill
Field Value
ActorEvent_OnSpawnSummon
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoSummon> ActorEvent_OnSpawnSummon
Field Value
ActorEvent_OnSpendMana
Note that ActorEvents can also be from its descendants.
Declaration
public SafeAction<EventInfoSpentMana> ActorEvent_OnSpendMana
Field Value
children
Alive, non-destroyed children actors.
Declaration
public readonly List<Actor> children
Field Value
| Type |
Description |
| System.Collections.Generic.List<T><Actor> |
|
childrenInNetwork
Children that are alive, or not yet despawned from the network.
Declaration
public readonly List<Actor> childrenInNetwork
Field Value
| Type |
Description |
| System.Collections.Generic.List<T><Actor> |
|
ClientActorEvent_OnCreate
Called everywhere when an actor is created including child actors.
Declaration
public SafeAction<Actor> ClientActorEvent_OnCreate
Field Value
ClientActorEvent_OnDestroyed
Called everywhere when this actor is destroyed.
Declaration
public SafeAction<Actor> ClientActorEvent_OnDestroyed
Field Value
ClientEvent_OnPersistentSyncedDataChanged
Declaration
public SafeAction<string> ClientEvent_OnPersistentSyncedDataChanged
Field Value
dealtCooldownReductionByRatioProcessor
Processor for dealt cooldown reductions by ratio. This is only valid on server.
All cooldown reductions done by this actor will be processed by this and every ancestor's preprocessors.
Declaration
public DataProcessorGroup<CooldownReductionByRatioSettings, Actor, AbilityTrigger> dealtCooldownReductionByRatioProcessor
Field Value
dealtCooldownReductionProcessor
Processor for dealt cooldown reductions of fixed amount. This is only valid on server.
All cooldown reductions done by this actor will be processed by this and every ancestor's preprocessors.
Declaration
public DataProcessorGroup<CooldownReductionSettings, Actor, AbilityTrigger> dealtCooldownReductionProcessor
Field Value
dealtDamageProcessor
Processor for all dealt damages (Except pure damage). This is only valid on server.
All damages from this actor will be processed by this and every ancestors' preprocessors.
Declaration
public DataProcessorGroup<DamageData, Actor, Entity> dealtDamageProcessor
Field Value
dealtHealProcessor
Processor for dealt heals. This is only valid on server.
All heals from this actor will be processed by this and every ancestors' preprocessors.
Declaration
public DataProcessorGroup<HealData, Actor, Entity> dealtHealProcessor
Field Value
dealtManaHealProcessor
Processor for dealt mana heals. This is only valid on server.
All mana heals from this actor will be processed by this and every ancestors' preprocessors.
Declaration
public DataProcessorGroup<HealData, Actor, Entity> dealtManaHealProcessor
Field Value
dealtShieldProcessor
Processor for received shields. This is only valid on server.
Declaration
public DataProcessorGroup<HealData, Actor, Entity> dealtShieldProcessor
Field Value
KilledByUnstoppableEffects
Declaration
public static Type[] KilledByUnstoppableEffects
Field Value
| Type |
Description |
| System.Type[] |
|
persistentData
Available on server. Generic persistent data storage that will be saved and loaded with this actor.
Declaration
[SaveVar(SaveVarFlags.Default)]
public readonly Dictionary<string, string> persistentData
Field Value
| Type |
Description |
| System.Collections.Generic.Dictionary<TKey, TValue><string, string> |
|
persistentSyncedData
Available everywhere, and can only be set on server. Generic persistent synced data storage that will be saved and loaded with this actor, and be synced across the network.
Use this to store states in the network context. (think: synced variables)
Declaration
[SaveVar(SaveVarFlags.Default)]
public readonly SyncDictionary<string, string> persistentSyncedData
Field Value
| Type |
Description |
| Mirror.SyncDictionary<TKey, TValue><string, string> |
|
ScaleDurationByTenacityEffects
Declaration
public static Type[] ScaleDurationByTenacityEffects
Field Value
| Type |
Description |
| System.Type[] |
|
spawnedChildVarDefProcessor
Declaration
public DataProcessorGroup<VariantDef, Actor, Type> spawnedChildVarDefProcessor
Field Value
Properties
ancestors
Enumerable ancestors of this actor. Ordering is the same as the actor tree order, first element being the direct parent.
Declaration
public IEnumerable<Actor> ancestors { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IEnumerable<T><Actor> |
|
chainTempName
Reaction chain of this actor. Available only on server.
Declaration
public ReactionChain chainTempName { get; }
Property Value
creationTime
Time of this actor's creation by Time.time.
Declaration
public float creationTime { get; }
Property Value
firstEntity
The first entity in this actor's ancestor tree.
This property can be used to e.g. find the caster of an ability instance.
Declaration
public Entity firstEntity { get; }
Property Value
firstTrigger
The first ability trigger in this actor's ancestor tree.
This property can be used to e.g. find the ability instance's trigger.
Declaration
public AbilityTrigger firstTrigger { get; }
Property Value
isActive
Declaration
public bool isActive { get; }
Property Value
isDestroyed
Declaration
public bool isDestroyed { get; }
Property Value
isDestroyedOnRoomChange
Declaration
public virtual bool isDestroyedOnRoomChange { get; }
Property Value
isDestroyLocked
Is someone preventing this actor from being destroyed? Available only on server.
Declaration
public bool isDestroyLocked { get; }
Property Value
isNewInstance
Is it this actor created in this session of the game, or has been loaded from save?
e.g. This will be false if this actor is part of a loaded game, or from previously visited node.
Declaration
public bool isNewInstance { get; }
Property Value
parentActor
Declaration
public Actor parentActor { get; set; }
Property Value
parentActorNetId
Declaration
public uint parentActorNetId { get; }
Property Value
persistentNetId
Mirror sets netId to 0 on despawn. This property will tell you its former netId even after being despawned.
Declaration
public uint persistentNetId { get; }
Property Value
position
Position of this actor. Same as transform.position.
Declaration
[SaveVar(SaveVarFlags.Default)]
public Vector3 position { get; set; }
Property Value
| Type |
Description |
| UnityEngine.Vector3 |
|
rotation
Rotation of this actor. Same as transform.rotation.
Declaration
[SaveVar(SaveVarFlags.Default)]
public Quaternion rotation { get; set; }
Property Value
| Type |
Description |
| UnityEngine.Quaternion |
|
Methods
ActiveFrameUpdate()
Called everywhere every frame while this actor is active.
Declaration
protected virtual void ActiveFrameUpdate()
ActiveLogicUpdate(float)
Called everywhere every logic tick while this actor is active.
Declaration
protected virtual void ActiveLogicUpdate(float dt)
Parameters
| Type |
Name |
Description |
| float |
dt |
|
AddData<T>(T)
Declaration
public void AddData<T>(T data)
Parameters
| Type |
Name |
Description |
| T |
data |
|
Type Parameters
ApplyCooldownReduction(AbilityTrigger, CooldownReductionSettings)
Apply cooldown reduction to all configs that can receive cooldown reduction.
Declaration
public void ApplyCooldownReduction(AbilityTrigger trigger, CooldownReductionSettings settings)
Parameters
ApplyCooldownReduction(AbilityTrigger, float, bool, bool)
Apply cooldown reduction to all configs that can receive cooldown reduction.
Declaration
public void ApplyCooldownReduction(AbilityTrigger trigger, float amount, bool scaled = true, bool ignoreCanReceiveCooldown = false)
Parameters
| Type |
Name |
Description |
| AbilityTrigger |
trigger |
|
| float |
amount |
|
| bool |
scaled |
|
| bool |
ignoreCanReceiveCooldown |
|
ApplyCooldownReductionByRatio(AbilityTrigger, CooldownReductionByRatioSettings)
Apply cooldown reduction to all configs that can receive cooldown reduction by ratio of max cooldown.
Declaration
public void ApplyCooldownReductionByRatio(AbilityTrigger trigger, CooldownReductionByRatioSettings settings)
Parameters
ApplyCooldownReductionByRatio(AbilityTrigger, float, bool)
Apply cooldown reduction to all configs that can receive cooldown reduction by ratio of max cooldown.
Declaration
public void ApplyCooldownReductionByRatio(AbilityTrigger trigger, float ratio, bool ignoreCanReceiveCooldown = false)
Parameters
| Type |
Name |
Description |
| AbilityTrigger |
trigger |
|
| float |
ratio |
|
| bool |
ignoreCanReceiveCooldown |
|
ApplyElemental(ElementalType, Entity, int)
Declaration
public ElementalStatusEffect ApplyElemental(ElementalType type, Entity to, int appliedStacks = 1)
Parameters
Returns
Awake()
Declaration
protected override void Awake()
Overrides
ClearExcludeFromRoomSave()
Clear flag that excludes this actor from room save.
Note this won't make non-saving by default actors to be saved.
Declaration
public void ClearExcludeFromRoomSave()
CreateAbilityInstance(Type, Vector3, Quaternion?, CastInfo, Action<AbilityInstance>)
Declaration
public AbilityInstance CreateAbilityInstance(Type type, Vector3 position, Quaternion? rotation, CastInfo info, Action<AbilityInstance> beforePrepare = null)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| UnityEngine.Vector3 |
position |
|
| UnityEngine.Quaternion? |
rotation |
|
| CastInfo |
info |
|
| System.Action<T><AbilityInstance> |
beforePrepare |
|
Returns
CreateAbilityInstance<T>(T, Vector3, Quaternion?, CastInfo, Action<T>)
Declaration
public T CreateAbilityInstance<T>(T prefab, Vector3 position, Quaternion? rotation, CastInfo info, Action<T> beforePrepare = null) where T : AbilityInstance
Parameters
| Type |
Name |
Description |
| T |
prefab |
|
| UnityEngine.Vector3 |
position |
|
| UnityEngine.Quaternion? |
rotation |
|
| CastInfo |
info |
|
| System.Action<T><T> |
beforePrepare |
|
Returns
Type Parameters
CreateAbilityInstance<T>(Vector3, Quaternion?, CastInfo, Action<T>)
Declaration
public T CreateAbilityInstance<T>(Vector3 position, Quaternion? rotation, CastInfo info, Action<T> beforePrepare = null) where T : AbilityInstance
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
position |
|
| UnityEngine.Quaternion? |
rotation |
|
| CastInfo |
info |
|
| System.Action<T><T> |
beforePrepare |
|
Returns
Type Parameters
CreateActor<T>(T, Vector3, Quaternion?, Action<T>)
Declaration
public T CreateActor<T>(T prefab, Vector3 pos, Quaternion? rot, Action<T> beforePrepare = null) where T : Actor
Parameters
| Type |
Name |
Description |
| T |
prefab |
|
| UnityEngine.Vector3 |
pos |
|
| UnityEngine.Quaternion? |
rot |
|
| System.Action<T><T> |
beforePrepare |
|
Returns
Type Parameters
CreateActor<T>(Vector3, Quaternion?, Action<T>)
Declaration
public T CreateActor<T>(Vector3 pos, Quaternion? rot, Action<T> beforePrepare = null) where T : Actor
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
pos |
|
| UnityEngine.Quaternion? |
rot |
|
| System.Action<T><T> |
beforePrepare |
|
Returns
Type Parameters
CreateBasicEffect(Entity, BasicEffect, float, string, DuplicateEffectBehavior)
Create a generic container status effect for applying basic effect to an entity.
Give an id of null to prevent this behavior.
The created status effect will be cleansable and killed by unstoppable if it contains a harmful effect.
Declaration
public Se_GenericEffectContainer CreateBasicEffect(Entity victim, BasicEffect eff, float duration, string id = null, DuplicateEffectBehavior onDuplicate = DuplicateEffectBehavior.ReplacePrevious)
Parameters
Returns
| Type |
Description |
| Se_GenericEffectContainer |
|
CreateDamage(SourceType, float, float)
Declaration
public DamageData CreateDamage(DamageData.SourceType type, float amount, float procCoefficient = 1)
Parameters
Returns
CreateStatusEffect(Type, Entity, CastInfo, Action<StatusEffect>)
Create a new status effect and attach it to an entity.
This can return null if the creation fails:
e.g. Trying to apply a status effect with isKilledByUnstoppable flag to an unstoppable/invulnerable entity.
Declaration
public StatusEffect CreateStatusEffect(Type type, Entity victim, CastInfo info, Action<StatusEffect> beforePrepare = null)
Parameters
Returns
CreateStatusEffect<T>(T, Entity, CastInfo, Action<T>)
Create a new status effect and attach it to an entity.
This can return null if the creation fails:
e.g. Trying to apply a status effect with isKilledByUnstoppable flag to an unstoppable/invulnerable entity.
Declaration
public T CreateStatusEffect<T>(T prefab, Entity victim, CastInfo info, Action<T> beforePrepare = null) where T : StatusEffect
Parameters
| Type |
Name |
Description |
| T |
prefab |
|
| Entity |
victim |
|
| CastInfo |
info |
|
| System.Action<T><T> |
beforePrepare |
|
Returns
Type Parameters
CreateStatusEffect<T>(Entity, CastInfo, Action<T>)
Create a new status effect and attach it to an entity.
This can return null if the creation fails:
e.g. Trying to apply a status effect with isKilledByUnstoppable flag to an unstoppable/invulnerable entity.
Declaration
public T CreateStatusEffect<T>(Entity victim, CastInfo info, Action<T> beforePrepare = null) where T : StatusEffect
Parameters
| Type |
Name |
Description |
| Entity |
victim |
|
| CastInfo |
info |
|
| System.Action<T><T> |
beforePrepare |
|
Returns
Type Parameters
CustomDestroyRoutine()
Declaration
public void CustomDestroyRoutine()
CustomRpc_ClearClientMessageHandlers()
Declaration
public void CustomRpc_ClearClientMessageHandlers()
CustomRpc_ClearServerMessageHandlers()
Declaration
public void CustomRpc_ClearServerMessageHandlers()
CustomRpc_RegisterClientMessageHandler<T>(Action<T>)
Register a client RPC handler. (server to clients) Registering multiple handlers for same type will result in all handlers passed being called.
Declaration
public void CustomRpc_RegisterClientMessageHandler<T>(Action<T> handler)
Parameters
| Type |
Name |
Description |
| System.Action<T><T> |
handler |
|
Type Parameters
CustomRpc_RegisterServerMessageHandler<T>(Action<T>)
Register a server RPC handler. (client to server) Registering multiple handlers for same type will result in all handlers passed being called.
Declaration
public void CustomRpc_RegisterServerMessageHandler<T>(Action<T> handler)
Parameters
| Type |
Name |
Description |
| System.Action<T><T> |
handler |
|
Type Parameters
CustomRpc_RegisterServerMessageHandler<T>(string, Action<T, DewPlayer>)
Register a server RPC handler. (client to server) Registering multiple handlers for same type will result in all handlers passed being called.
This variant allows you to receive the caller client as a parameter.
Declaration
public void CustomRpc_RegisterServerMessageHandler<T>(string type, Action<T, DewPlayer> handler)
Parameters
| Type |
Name |
Description |
| string |
type |
|
| System.Action<T1, T2><T, DewPlayer> |
handler |
|
Type Parameters
CustomRpc_SendMessageToAllClients<T>(T)
Make a remote procedure call: Server => All Clients
Declaration
public void CustomRpc_SendMessageToAllClients<T>(T msg)
Parameters
| Type |
Name |
Description |
| T |
msg |
|
Type Parameters
CustomRpc_SendMessageToClient<T>(DewPlayer, T)
Make a remote procedure call: Server => Specific Client
Declaration
public void CustomRpc_SendMessageToClient<T>(DewPlayer target, T msg)
Parameters
Type Parameters
CustomRpc_SendMessageToServer<T>(T)
Make a remote procedure call: Client => Server
Hosts can also make use of this RPC.
Declaration
public void CustomRpc_SendMessageToServer<T>(T msg)
Parameters
| Type |
Name |
Description |
| T |
msg |
|
Type Parameters
CustomRpc_UnregisterClientMessageHandler<T>()
Declaration
public void CustomRpc_UnregisterClientMessageHandler<T>()
Type Parameters
CustomRpc_UnregisterClientMessageHandler<T>(Action<T>)
Declaration
public void CustomRpc_UnregisterClientMessageHandler<T>(Action<T> handler)
Parameters
| Type |
Name |
Description |
| System.Action<T><T> |
handler |
|
Type Parameters
CustomRpc_UnregisterServerMessageHandler<T>()
Declaration
public void CustomRpc_UnregisterServerMessageHandler<T>()
Type Parameters
CustomRpc_UnregisterServerMessageHandler<T>(Action<T, DewPlayer>)
Declaration
public void CustomRpc_UnregisterServerMessageHandler<T>(Action<T, DewPlayer> handler)
Parameters
| Type |
Name |
Description |
| System.Action<T1, T2><T, DewPlayer> |
handler |
|
Type Parameters
CustomRpc_UnregisterServerMessageHandler<T>(Action<T>)
Declaration
public void CustomRpc_UnregisterServerMessageHandler<T>(Action<T> handler)
Parameters
| Type |
Name |
Description |
| System.Action<T><T> |
handler |
|
Type Parameters
DealDamage(DamageData, Entity, ReactionChain)
Deal custom damage to the target entity.
Declaration
public void DealDamage(DamageData damage, Entity target, ReactionChain chain = default)
Parameters
DefaultDamage(float, float)
Declaration
public DamageData DefaultDamage(float amount, float procCoefficient = 1)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
| float |
procCoefficient |
|
Returns
Destroy()
Destroy this actor.
It will do its own cleanups on server and then despawn.
This is irreversible.
Declaration
DestroyIfActive()
Declaration
public void DestroyIfActive()
DoBasicAttackHit(Entity, bool, bool, float, float)
Make the parent entity do basic attack and deal damage to the target entity.
By design this should be only used by basic attacks.
This triggers Attack Effects if the hit was successful.
Declaration
public void DoBasicAttackHit(Entity target, bool isCriticalHit, bool isMain, float damage, float attackEffect)
Parameters
| Type |
Name |
Description |
| Entity |
target |
|
| bool |
isCriticalHit |
|
| bool |
isMain |
|
| float |
damage |
|
| float |
attackEffect |
|
DoHeal(HealData, Entity, ReactionChain)
Heal an entity by some amount.
Declaration
public void DoHeal(HealData heal, Entity target, ReactionChain chain = default)
Parameters
DoManaHeal(HealData, Entity, ReactionChain)
Grant an entity some mana.
Declaration
public void DoManaHeal(HealData heal, Entity target, ReactionChain chain = default)
Parameters
ExcludeFromRoomSave()
Mark this actor as excluded from room save.
Declaration
public void ExcludeFromRoomSave()
FindData<T>(Predicate<T>)
Declaration
public T FindData<T>(Predicate<T> predicate)
Parameters
| Type |
Name |
Description |
| System.Predicate<T><T> |
predicate |
|
Returns
Type Parameters
FindFirstAncestorOfType<T>()
Find first actor that matches the given type in this actor's ancestor tree.
Declaration
public T FindFirstAncestorOfType<T>() where T : Actor
Returns
Type Parameters
FindFirstOfType<T>()
Find first actor that matches the given type in this actor's ancestor tree including itself.
Declaration
public T FindFirstOfType<T>() where T : Actor
Returns
Type Parameters
FrameUpdate()
Declaration
public override void FrameUpdate()
Overrides
GetActorReadableName()
Declaration
public virtual string GetActorReadableName()
Returns
GetData<T>()
Declaration
Returns
Type Parameters
GetNetworkAuthorityConnection()
Declaration
protected virtual NetworkConnectionToClient GetNetworkAuthorityConnection()
Returns
| Type |
Description |
| Mirror.NetworkConnectionToClient |
|
GetOriginalName()
Get the original name of this actor, excluding (Clone) or variant suffixes.
Useful when trying to figure out id of name-linked resources.
Declaration
public string GetOriginalName()
Returns
GiveShield(Entity, float, float, bool, ReactionChain)
Declaration
public Se_GenericShield_OneShot GiveShield(Entity victim, float amount, float duration, bool isDecay = false, ReactionChain chain = default)
Parameters
| Type |
Name |
Description |
| Entity |
victim |
|
| float |
amount |
|
| float |
duration |
|
| bool |
isDecay |
|
| ReactionChain |
chain |
|
Returns
| Type |
Description |
| Se_GenericShield_OneShot |
|
HasData<T>()
Declaration
Returns
Type Parameters
Heal(float)
Declaration
public HealData Heal(float amount)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
Returns
HideOnScreenTimerLocally(OnScreenTimerHandle)
Declaration
public void HideOnScreenTimerLocally(OnScreenTimerHandle handle)
Parameters
IsDescendantOf(Actor)
Is this actor a descendant of the given actor?
Is the given actor this actor's ancestor (parent/grand-parent/grand-grand-parent...)?
Declaration
public bool IsDescendantOf(Actor actor)
Parameters
| Type |
Name |
Description |
| Actor |
actor |
|
Returns
IsDescendantOf<T>()
Is this actor a descendant of the given actor?
Is the given actor this actor's ancestor (parent/grand-parent/grand-grand-parent...)?
Declaration
public bool IsDescendantOf<T>() where T : Actor
Returns
Type Parameters
IsExcludedFromRoomSave()
Is this actor marked as excluded from room saves?
Declaration
public bool IsExcludedFromRoomSave()
Returns
LockDestroy()
Prevent this actor from being destroyed. You MUST call UnlockDestroy() after LockDestroy() call.
Declaration
public void LockDestroy()
LogicUpdate(float)
Declaration
public override void LogicUpdate(float dt)
Parameters
| Type |
Name |
Description |
| float |
dt |
|
Overrides
MagicDamage(float, float)
Declaration
public DamageData MagicDamage(float amount, float procCoefficient = 1)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
| float |
procCoefficient |
|
Returns
OnCreate()
Called everywhere when this actor is created.
Declaration
protected virtual void OnCreate()
OnCreate_ActorData()
Declaration
public void OnCreate_ActorData()
OnDestroyActor()
Called everywhere when this actor is being destroyed.
This is different from similarly-named Unity event OnDestroy, as it is called before GameObject itself gets destroyed.
Declaration
protected virtual void OnDestroyActor()
OnDisable()
Declaration
protected virtual void OnDisable()
OnEnable()
Declaration
protected virtual void OnEnable()
OnPrepare()
Called on server right before actor is spawned.
Configure this actor's initial state here.
Declaration
protected virtual void OnPrepare()
OnStart()
Declaration
public override void OnStart()
Overrides
OnStartClient()
Declaration
public override void OnStartClient()
Overrides
OnStartServer()
Declaration
public override void OnStartServer()
Overrides
OnStopClient()
Declaration
public override void OnStopClient()
Overrides
OnStopServer()
Declaration
public override void OnStopServer()
Overrides
PhysicalDamage(float, float)
Declaration
public DamageData PhysicalDamage(float amount, float procCoefficient = 1)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
| float |
procCoefficient |
|
Returns
ProcessShieldAmount(float, Entity)
Declaration
public float ProcessShieldAmount(float amount, Entity target)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
| Entity |
target |
|
Returns
ProcessSpawnedChildVarDefProcessor(ref VariantDef, Type)
Declaration
public void ProcessSpawnedChildVarDefProcessor(ref VariantDef data, Type childType)
Parameters
| Type |
Name |
Description |
| VariantDef |
data |
|
| System.Type |
childType |
|
PureDamage(float, float)
Declaration
public DamageData PureDamage(float amount, float procCoefficient = 1)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
| float |
procCoefficient |
|
Returns
RefundMana(float, Entity)
Refund a certain amount of mana to an entity.
This will not be processed, will not proc any callbacks nor display a mana heal number text.
This shouldn't be used anywhere other than for canceled channels.
Declaration
public void RefundMana(float amount, Entity target)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
| Entity |
target |
|
RemoveData(object)
Declaration
public bool RemoveData(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
RemoveData<T>()
Declaration
public bool RemoveData<T>()
Returns
Type Parameters
ResetCooldown(AbilityTrigger, bool)
Declaration
public void ResetCooldown(AbilityTrigger trigger, bool ignoreCanReceiveCooldown = false)
Parameters
| Type |
Name |
Description |
| AbilityTrigger |
trigger |
|
| bool |
ignoreCanReceiveCooldown |
|
ShouldBeSavedWithRoom()
Should this actor be saved and loaded back in when revisiting nodes?
This is checked on server on all active actors when changing rooms.
Declaration
public virtual bool ShouldBeSavedWithRoom()
Returns
ShowOnScreenTimerLocally(OnScreenTimerHandle)
Show an on-screen timer with custom fill amount to local player.
Null rawText will be automatically populated.
Declaration
public OnScreenTimerHandle ShowOnScreenTimerLocally(OnScreenTimerHandle handle)
Parameters
Returns
SpawnEntity<T>(T, Vector3, Quaternion?, DewPlayer, int, Action<T>)
Declaration
public T SpawnEntity<T>(T entity, Vector3 pos, Quaternion? rot, DewPlayer owner, int level, Action<T> beforeSpawn = null) where T : Entity
Parameters
| Type |
Name |
Description |
| T |
entity |
|
| UnityEngine.Vector3 |
pos |
|
| UnityEngine.Quaternion? |
rot |
|
| DewPlayer |
owner |
|
| int |
level |
|
| System.Action<T><T> |
beforeSpawn |
|
Returns
Type Parameters
SpawnEntity<T>(Vector3, Quaternion?, DewPlayer, int, Action<T>)
Declaration
public T SpawnEntity<T>(Vector3 pos, Quaternion? rot, DewPlayer owner, int level, Action<T> beforeSpawn = null) where T : Entity
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
pos |
|
| UnityEngine.Quaternion? |
rot |
|
| DewPlayer |
owner |
|
| int |
level |
|
| System.Action<T><T> |
beforeSpawn |
|
Returns
Type Parameters
SpawnSummon<T>(Vector3, Quaternion?, Action<T>)
Declaration
public T SpawnSummon<T>(Vector3 position, Quaternion? rotation, Action<T> beforePrepare = null) where T : Summon
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
position |
|
| UnityEngine.Quaternion? |
rotation |
|
| System.Action<T><T> |
beforePrepare |
|
Returns
Type Parameters
SpendMana(float, Entity)
Spend mana of the entity.
Declaration
public void SpendMana(float amount, Entity target)
Parameters
| Type |
Name |
Description |
| float |
amount |
|
| Entity |
target |
|
Teleport(Entity, Vector3)
Teleport an entity to the targeted position.
You should only feed in a valid position by using Dew.GetValidAgentPosition() beforehand.
Declaration
public void Teleport(Entity entity, Vector3 position)
Parameters
| Type |
Name |
Description |
| Entity |
entity |
|
| UnityEngine.Vector3 |
position |
|
ToString()
Declaration
public override string ToString()
Returns
Overrides
UnityEngine.Object.ToString()
TrackKills(float, Action<EventInfoKill>)
Report any kills with contribution of this actor's damage with given grace period.
You must Stop() the tracker to properly dispose it.
Declaration
public KillTracker TrackKills(float gracePeriod, Action<EventInfoKill> callback)
Parameters
| Type |
Name |
Description |
| float |
gracePeriod |
|
| System.Action<T><EventInfoKill> |
callback |
|
Returns
TriggerAttackEffects(Entity, float, AttackEffectType, ReactionChain)
Declaration
public void TriggerAttackEffects(Entity target, float strength, AttackEffectType type, ReactionChain chain = default)
Parameters
TryFindData<T>(Predicate<T>, out T)
Declaration
public bool TryFindData<T>(Predicate<T> predicate, out T result)
Parameters
| Type |
Name |
Description |
| System.Predicate<T><T> |
predicate |
|
| T |
result |
|
Returns
Type Parameters
TryGetData<T>(out T)
Declaration
public bool TryGetData<T>(out T data)
Parameters
| Type |
Name |
Description |
| T |
data |
|
Returns
Type Parameters
UnlockDestroy()
Declaration
public void UnlockDestroy()
Explicit Interface Implementations
ICleanup.canDestroy
Declaration
bool ICleanup.canDestroy { get; }
Returns
ICleanup.OnCleanup()
Declaration
void ICleanup.OnCleanup()
ICustomDestroyRoutine.CustomDestroyRoutine()
Declaration
void ICustomDestroyRoutine.CustomDestroyRoutine()
Implements
Extension Methods