Beispiel #1
0
    // Remove value from the assigned unlockable object
    public void removeValue(GameObject obj)
    {
        ComboUnlockable script = obj.GetComponent <ComboUnlockable>();

        if (script != null)
        {
            script.Subtract(value);
        }
    }
Beispiel #2
0
    // Each object sends a value to the "unlockable" object, which will perform
    // an action when its total value reaches over its assigned threshold

    // Send a value to the assigned unlockable object
    public void sendValue(GameObject obj)
    {
        ComboUnlockable script = obj.GetComponent <ComboUnlockable>();

        if (script != null)
        {
            script.Add(value);
        }
    }
Beispiel #3
0
 // Remove value from all assigned unlockable objects
 public void removeValueToAll()
 {
     for (int i = 0; i < objects.Length; i++)
     {
         ComboUnlockable script = objects[i].GetComponent <ComboUnlockable>();
         if (script != null)
         {
             script.Subtract(value);
         }
     }
 }