Advertisement
Eresor

Untitled

Oct 26th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. public abstract class VariableReference<TBase, TScriptableVariable> where TScriptableVariable : ScriptableObjectVariable<TBase>
  2. {
  3.     [SerializeField] private bool useConstant;
  4.     [SerializeField] private TBase constantValue;
  5.     [SerializeField] private TScriptableVariable variable;
  6.  
  7.     public TBase Value => useConstant ? constantValue : variable.value;
  8. }
  9.  
  10. [Serializable]
  11. public class FloatReference : VariableReference<float,FloatVariable>
  12. {
  13.    
  14. }
  15.  
  16. public class TestBehaviour : MonoBehaviour
  17. {
  18.     public FloatReference floatRef;
  19.  
  20.     private void Start()
  21.     {
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement