public override bool Check(GlobalStorageObject storageObject) { if (storageObject.floats.ContainsKey(key)) { switch (comparisonType) { case ComparisonType.Equals: return(storageObject.GetFloat(key) == Other.Value); case ComparisonType.NotEqual: return(storageObject.GetFloat(key) != Other.Value); case ComparisonType.GreaterThan: return(storageObject.GetFloat(key) > Other.Value); case ComparisonType.LessThan: return(storageObject.GetFloat(key) < Other.Value); case ComparisonType.GreaterOrEqual: return(storageObject.GetFloat(key) >= Other.Value); case ComparisonType.LessOrEqual: return(storageObject.GetFloat(key) <= Other.Value); } } return(false); }
public void DoChecks(GlobalStorageObject storage) { if (storage == null || Checkers == null || Checkers.Length == 0) { return; } for (int i = 0; i < Checkers.Length; i++) { Checkers[i].DoChecks(storage); } }
public bool DoChecks(GlobalStorageObject storage) { if (storage != null) { for (var i = 0; i < checks.Count; i++) { if (checks[i].Check(storage) == false) { events.OnDoesNotHaveItem.Invoke(); return(false); } } events.OnHasItem.Invoke(); return(true); } return(false); }
internal void CreateSceneOlnyStorage() { storage = ScriptableObject.CreateInstance <GlobalStorageObject>(); storage.name = $"{gameObject.name}_TempStorage"; }
public virtual bool Check(GlobalStorageObject storage) { throw new System.NotImplementedException(); }
public override bool Check(GlobalStorageObject storage) { return(storage.GetBool(key) == isTrue); }
public void CopyValues(GlobalStorageObject other) { strings = new Dictionary <string, string>(other.strings); floats = new Dictionary <string, float>(other.floats); bools = new Dictionary <string, bool>(other.bools); }
public YarnStorageWrapper(GlobalStorageObject storage) { this.storage = storage; }