Show / Hide Table of Contents

Class GameResource

Scriptable Object that represents a resource/material in-game.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.ScriptableObject
GameResource
Implements
ISerializeReference
Inherited Members
UnityEngine.ScriptableObject.SetDirty()
UnityEngine.ScriptableObject.CreateInstance(System.String)
UnityEngine.ScriptableObject.CreateInstance(System.Type)
UnityEngine.ScriptableObject.CreateInstance<T>()
UnityEngine.Object.GetInstanceID()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
UnityEngine.Object.Destroy(UnityEngine.Object)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
UnityEngine.Object.FindObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType(System.Type, System.Boolean)
UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type, System.Boolean)
UnityEngine.Object.ToString()
UnityEngine.Object.name
UnityEngine.Object.hideFlags
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
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 true

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

Implements

ISerializeReference
In This Article
Back to top Generated by DocFX