Skip to content

Commit dd25c5a

Browse files
committed
Renamed CrosshairAware to Target
1 parent d5fb057 commit dd25c5a

5 files changed

Lines changed: 19 additions & 18 deletions

File tree

NewAPI/seyahdoo/crosshair/Crosshair.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static void SetupCrosshair()
5959

6060
}
6161

62-
private CrosshairAware _crosshairAware;
62+
private Target _target;
6363
private Collider _lastCollider;
6464

6565
/// <summary>
@@ -96,14 +96,14 @@ void Update()
9696
void focusToCollider(Collider collider)
9797
{
9898
//if i was focused to anything im not focused anymore
99-
if (_crosshairAware)
99+
if (_target)
100100
{
101101
///Dont bug me about its being obsolete! i maid it!
102102
#pragma warning disable 612, 618
103-
_crosshairAware.setFocus(false);
103+
_target.setFocus(false);
104104
#pragma warning restore 612, 618
105105

106-
_crosshairAware = null;
106+
_target = null;
107107
}
108108

109109
//im not hitting anything
@@ -112,15 +112,15 @@ void focusToCollider(Collider collider)
112112
//if im not looking to nothingness
113113
if (collider)
114114
{
115-
//im checking if this collider is Crosshair Aware?
116-
_crosshairAware = collider.gameObject.GetComponent<CrosshairAware>();
115+
//im checking if this collider is a Target?
116+
_target = collider.gameObject.GetComponent<Target>();
117117

118118
//if so, im focused to that
119-
if (_crosshairAware)
119+
if (_target)
120120
{
121121
///Dont bug me about its being obsolete! i maid it!
122122
#pragma warning disable 612, 618
123-
_crosshairAware.setFocus(true);
123+
_target.setFocus(true);
124124
#pragma warning restore 612, 618
125125
}
126126
}

NewAPI/seyahdoo/crosshair/CrosshairAware.cs renamed to NewAPI/seyahdoo/crosshair/Target.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
///Changelog:
99
///30.03.2017 -> Created by seyahdoo
10+
///31.03.2017 -> Renamed to Target from CrosshairAware
1011

1112
///usage:
1213
///Attach to any object and then you can watch HasFocus property or subscribe to FocusOnEvent and FocusOffEvent
@@ -25,7 +26,7 @@ namespace seyahdoo.crosshair
2526
/// You can also derive a class from this and use as such.
2627
/// </summary>
2728
[RequireComponent (typeof (Collider))]
28-
public class CrosshairAware : MonoBehaviour
29+
public class Target : MonoBehaviour
2930
{
3031

3132
private bool _hasFocus = false;
@@ -45,7 +46,7 @@ public bool HasFocus
4546

4647
/// <summary>
4748
/// object just get focused event
48-
/// Usage: crosshairAware.FocusOnEvent += MethodToSubscribe;
49+
/// Usage: target.FocusOnEvent += MethodToSubscribe;
4950
/// </summary>
5051
public event VoidDelegate FocusOnEvent;
5152

@@ -56,7 +57,7 @@ virtual protected void FocusOn() { }
5657

5758
/// <summary>
5859
/// object just get unfocused event
59-
/// Usage: crosshairAware.FocusOffEvent += MethodToSubscribe;
60+
/// Usage: target.FocusOffEvent += MethodToSubscribe;
6061
/// </summary>
6162
public event VoidDelegate FocusOffEvent;
6263

File renamed without changes.

NewAPI/seyahdoo/crosshair/examples/ColorChangingCube.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ namespace seyahdoo.crosshair.examples
88
/// <summary>
99
/// Crosshair example cube script, will go blue if stared by crosshair
1010
/// </summary>
11-
[RequireComponent (typeof (CrosshairAware))]
11+
[RequireComponent (typeof (Target))]
1212
[RequireComponent (typeof (MeshRenderer))]
1313
public class ColorChangingCube : MonoBehaviour
1414
{
1515

16-
private CrosshairAware ca;
16+
private Target target;
1717
private Material m;
1818

1919
void Awake()
2020
{
2121

2222
m = GetComponent<MeshRenderer>().material;
23-
ca = GetComponent<CrosshairAware>();
23+
target = GetComponent<Target>();
2424

25-
ca.FocusOnEvent += ColorBlue;
26-
ca.FocusOffEvent += ColorRed;
25+
target.FocusOnEvent += ColorBlue;
26+
target.FocusOffEvent += ColorRed;
2727
}
2828

2929
void ColorBlue()

NewAPI/seyahdoo/crosshair/examples/ColorCubeDerived.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
namespace seyahdoo.crosshair.examples
77
{
88
/// <summary>
9-
/// Simple Crosshair Aware cube, will go green if stared by Crosshair
9+
/// Simple Crosshair Target cube, will go green if stared by Crosshair
1010
/// </summary>
1111
[RequireComponent (typeof (MeshRenderer))]
12-
public class ColorCubeDerived : CrosshairAware
12+
public class ColorCubeDerived : Target
1313
{
1414

1515
Material m;

0 commit comments

Comments
 (0)