Пример #1
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);
        }
    }
Пример #2
0
 // Send a value to all assigned unlockable objects
 public void sendValueToAll()
 {
     for (int i = 0; i < objects.Length; i++)
     {
         ComboUnlockable script = objects[i].GetComponent <ComboUnlockable>();
         if (script != null)
         {
             script.Add(value);
         }
     }
 }