Class GameResource
Scriptable Object that represents a resource/material in-game.
Inheritance
Implements
Inherited Members
Namespace: GDA
Assembly: Assembly-CSharp.dll
Syntax
[CreateAssetMenu(menuName = "ScriptableObjects/Resource")]
public class GameResource : ScriptableObject, ISerializeReference
Fields
resourcesUsed
The resource usage required to produce 1g of the GameResource.
Declaration
public List<ResourceUsage> resourcesUsed
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<ResourceUsage> |
Properties
ID
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
System.String |
incinerationEmission
Unused. Emissions released by incinerating 1g of the GameResource.
Declaration
public float incinerationEmission { get; }
Property Value
Type | Description |
---|---|
System.Single |
incinerationEnergy
Unused. Energy released by incinerating 1g of the GameResource.
Declaration
public float incinerationEnergy { get; }
Property Value
Type | Description |
---|---|
System.Single |
legendColor
Color of the legend for this GameResource, used in diagrams and charts.
Declaration
public Color legendColor { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Color |
productionEmission
Unused. Emmisions generated by the production of 1g of the GameResource.
Declaration
public float productionEmission { get; }
Property Value
Type | Description |
---|---|
System.Single |
productionEnergy
If GDA.GameResource.overrideProductionEnegry false
: The energy required to produce 1g of the GameResource,
not including the energy needed to produce the resourcesUsed.
If GDA.GameResource.overrideProductionEnegry true
: The energy required to produce 1g of the GameResource,
including the energy needed to produce the resourcesUsed.
Declaration
public float productionEnergy { get; }
Property Value
Type | Description |
---|---|
System.Single |
scriptableObject
Declaration
public ScriptableObject scriptableObject { get; }
Property Value
Type | Description |
---|---|
UnityEngine.ScriptableObject |
totalDiscarded
Unused. Total amount of the GameResource discarded(via production inefficiencies etc) in the game.
Declaration
public float totalDiscarded { get; }
Property Value
Type | Description |
---|---|
System.Single |
totalSpent
Unused. Total amount of the GameResource used up (productively or otherwise) in the game.
Declaration
public float totalSpent { get; }
Property Value
Type | Description |
---|---|
System.Single |
totalUsage
Unused. Total amount of the GameResource used productively in the game.
Declaration
public float totalUsage { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
GetTotalProductionEnergy()
Gets the energy required to produce 1g of the GameResource.
Declaration
public float GetTotalProductionEnergy()
Returns
Type | Description |
---|---|
System.Single | Calculated production energy, or productionEnergy if GDA.GameResource.overrideProductionEnegry is |
GetTotalProductionWaste()
Gets the total weight of resources wasted in the production of 1g of the GameResource.
Declaration
public float GetTotalProductionWaste()
Returns
Type | Description |
---|---|
System.Single |
Use(Single, Single)
Adds the amtUsed
and amtDiscarded
to totalUsage and totalDiscarded for tracking.
Declaration
public void Use(float amtUsed, float amtDiscarded)
Parameters
Type | Name | Description |
---|---|---|
System.Single | amtUsed | |
System.Single | amtDiscarded |