예제 #1
0
    public override void OnInspectorGUI()
    {
        addR = target as AddRigidbody;

        EditorGUILayout.Separator();

        EditorGUI.BeginChangeCheck();
        GadgetIdentifier tmpIdent = (GadgetIdentifier)EditorGUILayout.EnumPopup("Key Gadget", addR.keyGadget);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(addR, "Change Key Gadget");
            addR.keyGadget = tmpIdent;
            EditorUtility.SetDirty(addR);
        }

        EditorGUILayout.Separator();

        EditorGUI.BeginChangeCheck();
        GameObject addTarget = (GameObject)EditorGUILayout.ObjectField("Target", addR.target, typeof(GameObject), true);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(addR, "Change Target");
            addR.target = addTarget;
            EditorUtility.SetDirty(addR);
        }
    }
예제 #2
0
 public bool Execute(GadgetIdentifier usedGagdet)
 {
     if (usedGagdet == keyGadget)
     {
         target.AddComponent<Rigidbody>();
         return true;
     }
     return false;
 }
예제 #3
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         DogAttributes.Instance.heldSkull = skullToWear;
         return true;
     }
     return false;
 }
예제 #4
0
 public bool Execute(GadgetIdentifier ident)
 {
     if (ident == keyGadget)
     {
         MessageSystem.GetInstance().StartDialogue(message);
         return true;
     }
     return false;
 }
예제 #5
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         DogAttributes.Instance.heldSkull = skullToWear;
         return(true);
     }
     return(false);
 }
예제 #6
0
 public bool Execute(GadgetIdentifier ident)
 {
     if (ident == keyGadget)
     {
         MessageSystem.GetInstance().StartDialogue(message);
         return(true);
     }
     return(false);
 }
예제 #7
0
 public bool Execute(GadgetIdentifier usedGagdet)
 {
     if (usedGagdet == keyGadget)
     {
         target.AddComponent <Rigidbody>();
         return(true);
     }
     return(false);
 }
예제 #8
0
    public bool Execute(GadgetIdentifier ident)
    {
        if (ident == keyGadget)
        {
            Destroy(objectToDestroy);
            return true;
        }

        return false;
    }
예제 #9
0
    public bool Execute(GadgetIdentifier ident)
    {
        if (ident == keyGadget)
        {
            Destroy(objectToDestroy);
            return(true);
        }

        return(false);
    }
예제 #10
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (castedObject.Execute(usedGadget))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #11
0
파일: Proxy.cs 프로젝트: Schadek/Skelevator
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (castedObject.Execute(usedGadget))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
예제 #12
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         for (int i = 0; i < toDelete.Length; i++)
         {
             Destroy(toDelete[i]);
         }
         return(true);
     }
     return(false);
 }
예제 #13
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         for (int i = 0; i < toDelete.Length; i++)
         {
             Destroy(toDelete[i]);
         }
         return true;
     }
     return false;
 }
예제 #14
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         if (inventory.AddGadgetToInventory(gadgetToAdd))
         {
             return(true);
         }
         else
         {
             Debug.Log("The requested gadget is already added to the inventory");
             return(false);
         }
     }
     return(false);
 }
예제 #15
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGagdet)
     {
         brickParent.SetActive(true);
         Vector3 forceVector = new Vector3(0, 0, -10f);
         for (int i = 0; i < bricks.Length; i++)
         {
             bricks[i].AddForce(forceVector, ForceMode.VelocityChange);
             destructors[i].TriggerSelfDestruction();
         }
         Destroy(gameObject);
         return(true);
     }
     return(false);
 }
예제 #16
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         if (inventory.AddGadgetToInventory(gadgetToAdd))
         {
             return true;
         }
         else
         {
             Debug.Log("The requested gadget is already added to the inventory");
             return false;
         }
     }
     return false;
 }
예제 #17
0
 public bool Execute(GadgetIdentifier ident)
 {
     Debug.Log("triggered");
     if (ident == keyGadget)
     {
         Debug.Log("is jaw");
         foreach (Rigidbody i in boulderBridge)
         {
             i.isKinematic = false;
             i.gameObject.layer = 8;
         }
         playerCollider.SetActive(true);
         return true;
     }
     return false;
 }
예제 #18
0
 public bool Execute(GadgetIdentifier ident)
 {
     Debug.Log("triggered");
     if (ident == keyGadget)
     {
         Debug.Log("is jaw");
         foreach (Rigidbody i in boulderBridge)
         {
             i.isKinematic      = false;
             i.gameObject.layer = 8;
         }
         playerCollider.SetActive(true);
         return(true);
     }
     return(false);
 }
예제 #19
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGagdet)
     {
         brickParent.SetActive(true);
         Vector3 forceVector = new Vector3(0, 0, -10f);
         for (int i = 0; i < bricks.Length; i++)
         {
             bricks[i].AddForce(forceVector, ForceMode.VelocityChange);
             destructors[i].TriggerSelfDestruction();
         }
         Destroy(gameObject);
         return true;
     }
     return false;
 }
예제 #20
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         StopAllCoroutines();
         if (isTurned)
         {
             StartCoroutine(turnUpright());
         }
         else
         {
             StartCoroutine(turnUpsideDown());
         }
         return(true);
     }
     return(false);
 }
예제 #21
0
파일: Cross.cs 프로젝트: Schadek/Skelevator
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGadget)
     {
         StopAllCoroutines();
         if (isTurned)
         {
             StartCoroutine(turnUpright());
         }
         else
         {
             StartCoroutine(turnUpsideDown());
         }
         return true;
     }
     return false;
 }
예제 #22
0
    public bool Execute(GadgetIdentifier ident)
    {
        if (ident == keyGadget && !platformScript.humanOnTop)
        {
            StopAllCoroutines();

            if (lifted)
            {
                StartCoroutine(LiftPlatform(false));
            }
            else
            {
                StartCoroutine(LiftPlatform(true));
            }
            return(true);
        }
        return(false);
    }
예제 #23
0
    public bool Execute(GadgetIdentifier ident)
    {
        if (ident == keyGadget && !platformScript.humanOnTop)
        {
            StopAllCoroutines();

            if (lifted)
            {
                StartCoroutine(LiftPlatform(false));
            }
            else
            {
                StartCoroutine(LiftPlatform(true));
            }
            return true;
        }
        return false;
    }
예제 #24
0
파일: Door.cs 프로젝트: Schadek/Skelevator
 public bool Execute(GadgetIdentifier ident)
 {
     if (ident == keyGadget)
     {
         if (open)
         {
             StopAllCoroutines();
             StartCoroutine(closeDoor());
             return true;
         }
         else
         {
             StopAllCoroutines();
             StartCoroutine(openDoor());
             return true;
         }
     }
     return false;
 }
예제 #25
0
 public bool Execute(GadgetIdentifier ident)
 {
     if (ident == keyGadget)
     {
         if (open)
         {
             StopAllCoroutines();
             StartCoroutine(closeDoor());
             return(true);
         }
         else
         {
             StopAllCoroutines();
             StartCoroutine(openDoor());
             return(true);
         }
     }
     return(false);
 }
예제 #26
0
파일: Torch.cs 프로젝트: Schadek/Skelevator
 public bool Execute(GadgetIdentifier ident)
 {
     if (gameObject.activeSelf)
     {
         if (ident == keyGadget)
         {
             StopAllCoroutines();
             if (lit)
             {
                 StartCoroutine(PutOutTorch());
             }
             else
             {
                 StartCoroutine(LightTorch());
             }
             return true;
         }
     }
     return false;
 }
예제 #27
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGagdet)
     {
         if (mustBeOpen)
         {
             if (door.open)
             {
                 KnockOff();
                 return(true);
             }
         }
         else
         {
             KnockOff();
             return(true);
         }
     }
     return(false);
 }
예제 #28
0
 public bool Execute(GadgetIdentifier usedGadget)
 {
     if (usedGadget == keyGagdet)
     {
         if (mustBeOpen)
         {
             if (door.open)
             {
                 KnockOff();
                 return true;
             }
         }
         else
         {
             KnockOff();
             return true;
         }
     }
     return false;
 }
예제 #29
0
파일: Torch.cs 프로젝트: Schadek/Skelevator
 public bool Execute(GadgetIdentifier ident)
 {
     if (gameObject.activeSelf)
     {
         if (ident == keyGadget)
         {
             StopAllCoroutines();
             if (lit)
             {
                 StartCoroutine(PutOutTorch());
             }
             else
             {
                 StartCoroutine(LightTorch());
             }
             return(true);
         }
     }
     return(false);
 }
예제 #30
0
    protected bool TryInvoking(IInteractable[] list, GadgetIdentifier identifier)
    {
        //If any gadget was invoked successfully, we return true in the end
        bool anyGadgetFired = false;

        for (int i = 0; i < list.Length; i++)
        {
            if (list[i].Execute(identifier))
            {
                anyGadgetFired = true;
            }
        }

        if (anyGadgetFired)
        {
            return true;
        }

        //Usually this should return false because no action was fired at this point.
        //To prevent the system from skipping to the next nearest object we simply always
        //tell it that the invocation was a success
        return true;
    }
예제 #31
0
    protected bool TryInvoking(IInteractable[] list, GadgetIdentifier identifier)
    {
        //If any gadget was invoked successfully, we return true in the end
        bool anyGadgetFired = false;

        for (int i = 0; i < list.Length; i++)
        {
            if (list[i].Execute(identifier))
            {
                anyGadgetFired = true;
            }
        }

        if (anyGadgetFired)
        {
            return(true);
        }

        //Usually this should return false because no action was fired at this point.
        //To prevent the system from skipping to the next nearest object we simply always
        //tell it that the invocation was a success
        return(true);
    }