Skip to content

Commit

Permalink
renamed target to targets
Browse files Browse the repository at this point in the history
  • Loading branch information
cpimhoff committed Mar 13, 2017
1 parent 3f4f98b commit 2154fbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 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
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

0 comments on commit 2154fbb

Please sign in to comment.