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); } }
public bool Execute(GadgetIdentifier usedGagdet) { if (usedGagdet == keyGadget) { target.AddComponent<Rigidbody>(); return true; } return false; }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGadget) { DogAttributes.Instance.heldSkull = skullToWear; return true; } return false; }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget) { MessageSystem.GetInstance().StartDialogue(message); return true; } return false; }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGadget) { DogAttributes.Instance.heldSkull = skullToWear; return(true); } return(false); }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget) { MessageSystem.GetInstance().StartDialogue(message); return(true); } return(false); }
public bool Execute(GadgetIdentifier usedGagdet) { if (usedGagdet == keyGadget) { target.AddComponent <Rigidbody>(); return(true); } return(false); }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget) { Destroy(objectToDestroy); return true; } return false; }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget) { Destroy(objectToDestroy); return(true); } return(false); }
public bool Execute(GadgetIdentifier usedGadget) { if (castedObject.Execute(usedGadget)) { return(true); } else { return(false); } }
public bool Execute(GadgetIdentifier usedGadget) { if (castedObject.Execute(usedGadget)) { return true; } else { return false; } }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGadget) { for (int i = 0; i < toDelete.Length; i++) { Destroy(toDelete[i]); } return(true); } return(false); }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGadget) { for (int i = 0; i < toDelete.Length; i++) { Destroy(toDelete[i]); } return true; } return false; }
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); }
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); }
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; }
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; }
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); }
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; }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGadget) { StopAllCoroutines(); if (isTurned) { StartCoroutine(turnUpright()); } else { StartCoroutine(turnUpsideDown()); } return(true); } return(false); }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGadget) { StopAllCoroutines(); if (isTurned) { StartCoroutine(turnUpright()); } else { StartCoroutine(turnUpsideDown()); } return true; } return false; }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget && !platformScript.humanOnTop) { StopAllCoroutines(); if (lifted) { StartCoroutine(LiftPlatform(false)); } else { StartCoroutine(LiftPlatform(true)); } return(true); } return(false); }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget && !platformScript.humanOnTop) { StopAllCoroutines(); if (lifted) { StartCoroutine(LiftPlatform(false)); } else { StartCoroutine(LiftPlatform(true)); } return true; } return false; }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget) { if (open) { StopAllCoroutines(); StartCoroutine(closeDoor()); return true; } else { StopAllCoroutines(); StartCoroutine(openDoor()); return true; } } return false; }
public bool Execute(GadgetIdentifier ident) { if (ident == keyGadget) { if (open) { StopAllCoroutines(); StartCoroutine(closeDoor()); return(true); } else { StopAllCoroutines(); StartCoroutine(openDoor()); return(true); } } return(false); }
public bool Execute(GadgetIdentifier ident) { if (gameObject.activeSelf) { if (ident == keyGadget) { StopAllCoroutines(); if (lit) { StartCoroutine(PutOutTorch()); } else { StartCoroutine(LightTorch()); } return true; } } return false; }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGagdet) { if (mustBeOpen) { if (door.open) { KnockOff(); return(true); } } else { KnockOff(); return(true); } } return(false); }
public bool Execute(GadgetIdentifier usedGadget) { if (usedGadget == keyGagdet) { if (mustBeOpen) { if (door.open) { KnockOff(); return true; } } else { KnockOff(); return true; } } return false; }
public bool Execute(GadgetIdentifier ident) { if (gameObject.activeSelf) { if (ident == keyGadget) { StopAllCoroutines(); if (lit) { StartCoroutine(PutOutTorch()); } else { StartCoroutine(LightTorch()); } return(true); } } return(false); }
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; }
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); }