Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
        }
    }
Ejemplo n.º 3
0
 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";
 }
Ejemplo n.º 5
0
 public virtual bool Check(GlobalStorageObject storage)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 6
0
 public override bool Check(GlobalStorageObject storage)
 {
     return(storage.GetBool(key) == isTrue);
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 public YarnStorageWrapper(GlobalStorageObject storage)
 {
     this.storage = storage;
 }