From 3ae9f05a9c7e24d85f8ccb5f58b923f7500fc39b Mon Sep 17 00:00:00 2001 From: Charlie Imhoff Date: Mon, 13 Mar 2017 14:20:19 -0500 Subject: [PATCH 1/3] unused exception var `e` --- Project/Assets/Editor/Twine Importer/TwineImporterUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project/Assets/Editor/Twine Importer/TwineImporterUI.cs b/Project/Assets/Editor/Twine Importer/TwineImporterUI.cs index 0dd22bb7..eff5f5d9 100644 --- a/Project/Assets/Editor/Twine Importer/TwineImporterUI.cs +++ b/Project/Assets/Editor/Twine Importer/TwineImporterUI.cs @@ -117,7 +117,7 @@ private bool isValidJson() // that it has a "startnode" attribute. Valid Twison must // have a startnode indicator! return parsedJson["startnode"] != null; - } catch (Exception e) + } catch { return false; } From 3f4f98bf679251330c79fdaf310b33102a2cd861 Mon Sep 17 00:00:00 2001 From: Charlie Imhoff Date: Mon, 13 Mar 2017 14:20:28 -0500 Subject: [PATCH 2/3] unused list var --- .../Framework/Script/Interaction/FirstPersonInteractor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Project/Assets/Prairie/Framework/Script/Interaction/FirstPersonInteractor.cs b/Project/Assets/Prairie/Framework/Script/Interaction/FirstPersonInteractor.cs index 5af787f4..f2af6641 100644 --- a/Project/Assets/Prairie/Framework/Script/Interaction/FirstPersonInteractor.cs +++ b/Project/Assets/Prairie/Framework/Script/Interaction/FirstPersonInteractor.cs @@ -144,7 +144,6 @@ public void OnTriggerEnter(Collider other) { GameObject inside = other.gameObject; // automatically trigger area we're now inside of's interactions - List toTrigger = new List(); foreach (Interaction i in inside.GetComponents ()) { if (!(i is Annotation)) From 2154fbba870f06fee90d55bbf91af5697a59638c Mon Sep 17 00:00:00 2001 From: Charlie Imhoff Date: Mon, 13 Mar 2017 14:23:03 -0500 Subject: [PATCH 3/3] renamed `target` to `targets` --- .../ComponentToggleInteractionEditor.cs | 6 +++--- .../Script/Interaction/ComponentToggleInteraction.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Project/Assets/Editor/CustomInspectors/ComponentToggleInteractionEditor.cs b/Project/Assets/Editor/CustomInspectors/ComponentToggleInteractionEditor.cs index 17e77a7a..2f276fc2 100644 --- a/Project/Assets/Editor/CustomInspectors/ComponentToggleInteractionEditor.cs +++ b/Project/Assets/Editor/CustomInspectors/ComponentToggleInteractionEditor.cs @@ -15,13 +15,13 @@ public override void OnInspectorGUI () { // Configuration: bool _repeatable = EditorGUILayout.Toggle ("Repeatable?", componentToggle.repeatable); - Behaviour[] _targets = PrairieGUI.drawObjectList ("Behaviours To Toggle:", componentToggle.target); + Behaviour[] _targets = PrairieGUI.drawObjectList ("Behaviours To Toggle:", componentToggle.targets); // Save: if (GUI.changed) { Undo.RecordObject(componentToggle, "Modify Component Toggle"); componentToggle.repeatable = _repeatable; - componentToggle.target = _targets; + componentToggle.targets = _targets; } // Warnings (after properties have been updated): @@ -30,7 +30,7 @@ public override void OnInspectorGUI () public void DrawWarnings() { - foreach (Behaviour behaviour in componentToggle.target) + foreach (Behaviour behaviour in componentToggle.targets) { if (behaviour == null) { diff --git a/Project/Assets/Prairie/Framework/Script/Interaction/ComponentToggleInteraction.cs b/Project/Assets/Prairie/Framework/Script/Interaction/ComponentToggleInteraction.cs index 39115a13..5b802e4c 100644 --- a/Project/Assets/Prairie/Framework/Script/Interaction/ComponentToggleInteraction.cs +++ b/Project/Assets/Prairie/Framework/Script/Interaction/ComponentToggleInteraction.cs @@ -4,17 +4,17 @@ [AddComponentMenu("Prairie/Interactions/Toggle Component")] public class ComponentToggleInteraction : PromptInteraction { - public Behaviour[] target = new Behaviour[0]; + public Behaviour[] targets = new Behaviour[0]; void OnDrawGizmosSelected() { Gizmos.color = Color.red; - for (int i = 0; i < target.Length; i++) + for (int i = 0; i < targets.Length; i++) { // Draw red line(s) between the object and the objects whose Behaviours it toggles - if (target[i] != null) + if (targets[i] != null) { - Gizmos.DrawLine(transform.position, target[i].transform.position); + Gizmos.DrawLine(transform.position, targets[i].transform.position); } } @@ -22,9 +22,9 @@ void OnDrawGizmosSelected() protected override void PerformAction () { - for (int i = 0; i < target.Length; i++) + for (int i = 0; i < targets.Length; i++) { - target[i].enabled = !target[i].enabled; + targets[i].enabled = !targets[i].enabled; } }