Skip to content

Commit

Permalink
Merge pull request #173 from mjavaly/cpimhoff/last-fixes
Browse files Browse the repository at this point in the history
Some Last Cleanups
  • Loading branch information
grahamearley authored Mar 13, 2017
2 parents 45c65de + 2154fbb commit 33c5bea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public override void OnInspectorGUI ()
{
// Configuration:
bool _repeatable = EditorGUILayout.Toggle ("Repeatable?", componentToggle.repeatable);
Behaviour[] _targets = PrairieGUI.drawObjectList<Behaviour> ("Behaviours To Toggle:", componentToggle.target);
Behaviour[] _targets = PrairieGUI.drawObjectList<Behaviour> ("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):
Expand All @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Project/Assets/Editor/Twine Importer/TwineImporterUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
[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);
}

}
}

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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public void OnTriggerEnter(Collider other)
{
GameObject inside = other.gameObject;
// automatically trigger area we're now inside of's interactions
List<Interaction> toTrigger = new List<Interaction>();
foreach (Interaction i in inside.GetComponents<Interaction> ())
{
if (!(i is Annotation))
Expand Down

0 comments on commit 33c5bea

Please sign in to comment.