Skip to content
Snippets Groups Projects
Commit 5179d881 authored by michael's avatar michael
Browse files

Added scriptable vars shared code and removed meta-less readme.

parent cb0baf02
No related branches found
No related tags found
No related merge requests found
Pipeline #1962 canceled
using UnityEngine;
namespace Shared.ScriptableVariables {
// A reference to a boolean value to share across components, scenes, and prefabs that can be overridden to a constant different value
public class ReferenceScriptableVariable<TScriptableVariable, TValueType> : ScriptableVariable where TScriptableVariable : ScriptableVariable<TValueType> {
[Tooltip("Whether to use the referenced value or a constant value")]
public bool useConstant;
[Tooltip("An override constant value to use instead of the reference value")]
public TValueType constantValue;
[Tooltip("The variable this component is referencing")]
public TScriptableVariable referenceValue;
public TValueType Value { get { return useConstant ? constantValue : referenceValue.Value; } set { referenceValue.Value = value; } }
}
}
fileFormatVersion: 2
guid: 036ed80159a9c6340a57b5ab8830d4b6
timeCreated: 1510599427
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace Shared.ScriptableVariables {
// A reference to a string value to share across components, scenes, and prefabs that can be overridden to a constant different value
[CreateAssetMenu(menuName = "Scriptable Objects/Variables/Reference/String")]
public class ReferenceStringVariable : ReferenceScriptableVariable<StringVariable, string> {
}
}
fileFormatVersion: 2
guid: 37c1a078c5908a54d9b514dcd4c35db1
timeCreated: 1510599427
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment