Class ResourceUsage
Serializable class representing a particular usage rate of a GameResource.
Inheritance
System.Object
ResourceUsage
Implements
UnityEngine.ISerializationCallbackReceiver
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GDA
Assembly: Assembly-CSharp.dll
Syntax
[Serializable]
public class ResourceUsage : ISerializationCallbackReceiver
Constructors
ResourceUsage(GameResource, Single, Single, Single, Single)
Declaration
public ResourceUsage(GameResource resource, float usage, float wastage, float useVariance = 0F, float wasteVariance = 0F)
Parameters
Type | Name | Description |
---|---|---|
GameResource | resource | |
System.Single | usage | |
System.Single | wastage | |
System.Single | useVariance | |
System.Single | wasteVariance |
Fields
name
Name of the resource being used
Declaration
[HideInInspector]
public string name
Field Value
Type | Description |
---|---|
System.String |
Properties
resource
The resource being used
Declaration
[JsonIgnore]
public GameResource resource { get; }
Property Value
Type | Description |
---|---|
GameResource |
usageVariance
The variability of the usage rate.
Declaration
[JsonIgnore]
public float usageVariance { get; }
Property Value
Type | Description |
---|---|
System.Single |
used
The usage rate of the resource.
Declaration
[JsonIgnore]
public float used { get; }
Property Value
Type | Description |
---|---|
System.Single |
wastage
The inefficiency/wastage rate in the usage of the resource.
Declaration
[JsonIgnore]
public float wastage { get; }
Property Value
Type | Description |
---|---|
System.Single |
wastageVariance
The variability of the wastage rate.
Declaration
[JsonIgnore]
public float wastageVariance { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()
Implements
UnityEngine.ISerializationCallbackReceiver