Class Treasure
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
Mirror.NetworkBehaviour
Treasure
Assembly: Dew.Core.dll
Syntax
[DewResourceLink(ResourceLinkBy.Type)]
public abstract class Treasure : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine, IExcludeFromPool
Fields
basePrice
Declaration
[BoxGroup("Treasure Settings", true, false, 0)]
public int basePrice
Field Value
chanceWeight
Declaration
[HideIf("@excludeFromPool", true)]
[BoxGroup("Treasure Settings", true, false, 0)]
public float chanceWeight
Field Value
excludeFromPool
Declaration
[BoxGroup("Treasure Settings", true, false, 0)]
public bool excludeFromPool
Field Value
icon
Declaration
[BoxGroup("Treasure Settings", true, false, 0)]
public Sprite icon
Field Value
| Type |
Description |
| UnityEngine.Sprite |
|
maxUse
Declaration
[BoxGroup("Treasure Settings", true, false, 0)]
public int maxUse
Field Value
Properties
customData
Declaration
public string customData { get; set; }
Property Value
hero
Declaration
public Hero hero { get; set; }
Property Value
merchant
Declaration
public PropEnt_Merchant_Base merchant { get; set; }
Property Value
player
Declaration
public DewPlayer player { get; set; }
Property Value
price
Declaration
public int price { get; set; }
Property Value
Methods
CanBePurchased()
This is checked on server upon purchase. If this returns false, purchase will not be made. You should show some kind of message to the user if this returns false.
This is invoked on a prefab, and before being invoked, relevant fields like hero / player will be populated.
Declaration
public virtual bool CanBePurchased()
Returns
GetCustomDescription()
Declaration
public virtual string GetCustomDescription()
Returns
GetCustomName()
Declaration
public virtual string GetCustomName()
Returns
OnAddMerchandise(out Cost, out string)
Declaration
public virtual void OnAddMerchandise(out Cost mercPrice, out string customData)
Parameters
| Type |
Name |
Description |
| Cost |
mercPrice |
|
| string |
customData |
|
ShouldBeIncludedInPool()
This is checked on server when populating for each player. If this returns false, this treasure will not be included in the pool.
Declaration
public virtual bool ShouldBeIncludedInPool()
Returns
Explicit Interface Implementations
IExcludeFromPool.excludeFromPool
Declaration
bool IExcludeFromPool.excludeFromPool { get; }
Returns
Implements
Extension Methods