Class Shrine
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
Mirror.NetworkBehaviour
Shrine
Assembly: Dew.Core.dll
Syntax
public abstract class Shrine : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine, IInteractable, IProp, IBanRoomNodesNearby
Fields
availableEffect
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject availableEffect
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
baseGoldCost
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public int baseGoldCost
Field Value
ClientEvent_OnSuccessfulUse
Called everywhere after an entity uses this shrine successfully.
Declaration
public SafeAction<Entity> ClientEvent_OnSuccessfulUse
Field Value
interactableDelay
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public float interactableDelay
Field Value
lockedEffect
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject lockedEffect
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
mapVisibility
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public MapItemVisibility mapVisibility
Field Value
maxTotalUseCount
Declaration
[SaveVar(SaveVarFlags.Default)]
[FormerlySerializedAs("maxUseCount")]
[BoxGroup("Shrine Settings", true, false, 0)]
public int maxTotalUseCount
Field Value
maxUseCountPerPlayer
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public int maxUseCountPerPlayer
Field Value
model
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject model
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
unavailableByDefault
Declaration
[ToggleLeft]
[BoxGroup("Shrine Settings", true, false, 0)]
public bool unavailableByDefault
Field Value
unavailableEffect
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject unavailableEffect
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
unlockEffect
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject unlockEffect
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
useCooldown
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public float useCooldown
Field Value
useEffect
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject useEffect
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
useEffectLocal
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject useEffectLocal
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
useLockedEffect
Declaration
[BoxGroup("Shrine Settings", true, false, 0)]
public GameObject useLockedEffect
Field Value
| Type |
Description |
| UnityEngine.GameObject |
|
Properties
canInteractWithMouse
Declaration
public virtual bool canInteractWithMouse { get; }
Property Value
focusDistance
Declaration
public float focusDistance { get; }
Property Value
interactPivot
Declaration
public virtual Transform interactPivot { get; }
Property Value
| Type |
Description |
| UnityEngine.Transform |
|
isAvailable
Declaration
[SaveVar(SaveVarFlags.Default)]
public bool isAvailable { get; set; }
Property Value
isLocked
Declaration
[SaveVar(SaveVarFlags.Default)]
public bool isLocked { get; set; }
Property Value
isOnCooldown
Declaration
public bool isOnCooldown { get; }
Property Value
isRegularReward
Declaration
public virtual bool isRegularReward { get; }
Property Value
scaleSpawnRateWithPlayers
Declaration
public bool scaleSpawnRateWithPlayers { get; }
Property Value
totalUseCount
Declaration
[SaveVar(SaveVarFlags.Default)]
public int totalUseCount { get; set; }
Property Value
Methods
CanAfford(Entity)
Declaration
public AffordType CanAfford(Entity entity)
Parameters
| Type |
Name |
Description |
| Entity |
entity |
|
Returns
CanInteract(Entity)
Declaration
public virtual bool CanInteract(Entity entity)
Parameters
| Type |
Name |
Description |
| Entity |
entity |
|
Returns
DoPostUseRoutines(Entity)
Deduct cost from the entity, increment use count and invoke callbacks.
Declaration
public void DoPostUseRoutines(Entity entity)
Parameters
| Type |
Name |
Description |
| Entity |
entity |
|
GetClosestPointOnShrine(Vector3)
Declaration
public Vector3 GetClosestPointOnShrine(Vector3 pos)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
pos |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
GetCost(Entity)
Get gold/health cost of this shrine for specified activator. This must return consistent values across server and clients.
Declaration
public virtual Cost? GetCost(Entity activator)
Parameters
| Type |
Name |
Description |
| Entity |
activator |
|
Returns
GetRandomSpawnPosition(Vector3)
Declaration
public Vector3 GetRandomSpawnPosition(Vector3 activatorPos)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
activatorPos |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
GetUseCountByPlayer(DewPlayer)
Declaration
public int GetUseCountByPlayer(DewPlayer player)
Parameters
Returns
MakeAvailable()
Forcibly make the shrine available for use. Callable on server.
Declaration
[Button]
public void MakeAvailable()
MakeUnavailable()
Forcibly make the shrine unavailable for use. Callable on server.
Declaration
[Button]
public void MakeUnavailable()
OnCreate()
Declaration
protected override void OnCreate()
Overrides
OnDestroyActor()
Declaration
protected override void OnDestroyActor()
Overrides
OnInteract(Entity, bool)
Declaration
public virtual void OnInteract(Entity entity, bool alt)
Parameters
| Type |
Name |
Description |
| Entity |
entity |
|
| bool |
alt |
|
OnUse(Entity)
Called on server when an entity uses this shrine. Return value must indicate success of this use.
Returning true will play use effect, increment use count, and deduct cost from entity.
Declaration
protected abstract bool OnUse(Entity entity)
Parameters
| Type |
Name |
Description |
| Entity |
entity |
|
Returns
ResetUseCounts()
Declaration
public void ResetUseCounts()
ShouldBeSavedWithRoom()
Declaration
public override bool ShouldBeSavedWithRoom()
Returns
Overrides
Explicit Interface Implementations
IInteractable.priority
Declaration
int IInteractable.priority { get; }
Returns
Implements
Extension Methods