Skip to content

Commit 433ae40

Browse files
committed
Supply tooltips.
1 parent b944b06 commit 433ae40

File tree

4 files changed

+38
-35
lines changed

4 files changed

+38
-35
lines changed

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DFlyAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace JCSUnity
1414
{
1515
/// <summary>
16-
/// Action does the fly action on 2D.
16+
/// Action does the AI fly action on 2D.
1717
/// </summary>
1818
[RequireComponent(typeof(JCS_CharacterControllerInfo))]
1919
[RequireComponent(typeof(JCS_VelocityInfo))]

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DJumpAction.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
namespace JCSUnity
1414
{
1515
/// <summary>
16-
/// Simulate the AI to do jump base on
17-
/// the random possiblity time zone.
16+
/// Action does the AI jump action in 2D.
1817
/// </summary>
1918
[RequireComponent(typeof(JCS_CharacterControllerInfo))]
2019
[RequireComponent(typeof(JCS_VelocityInfo))]
@@ -72,13 +71,13 @@ [SerializeField] [Range(0.0f, 3.0f)]
7271
[Tooltip(@"Addition value to the jump force. For
7372
instance value 5, will generate -5 ~ 5 and add it on to current jump force.")]
7473
[SerializeField]
75-
[Range(1, 10)]
76-
private float mRandomJumpForceRange = 5;
74+
[Range(1.0f, 10.0f)]
75+
private float mRandomJumpForceRange = 5.0f;
7776

7877

7978
[Header("** Optional Settings (JCS_2DJumpAction) **")]
8079

81-
[Tooltip("Plz fill this is there is animation going on to this game object.")]
80+
[Tooltip("Live object animation.")]
8281
// Animator in order to set the animation.
8382
[SerializeField]
8483
private JCS_2DLiveObjectAnimator mLiveObjectAnimator = null;
@@ -156,6 +155,9 @@ private void Update()
156155
//----------------------
157156
// Public Functions
158157

158+
/// <summary>
159+
/// Do the jump by possibility.
160+
/// </summary>
159161
public void JumpByPossibility()
160162
{
161163
float possibility = JCS_Random.Range(0, 100);
@@ -165,6 +167,10 @@ public void JumpByPossibility()
165167

166168
Jump();
167169
}
170+
171+
/// <summary>
172+
/// Do the jump action.
173+
/// </summary>
168174
public void Jump()
169175
{
170176
Jump(mJumpForce);
@@ -199,7 +205,7 @@ public void Jump(float force)
199205
// Private Functions
200206

201207
/// <summary>
202-
///
208+
/// Do jump implementation.
203209
/// </summary>
204210
/// <returns> true: do jump, flase: dont do jump </returns>
205211
private void DoJump()

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DSwimAction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* $Date: $
44
* $Revision: $
55
* $Creator: Jen-Chieh Shen $
6-
* $Notice: See LICENSE.txt for modification and distribution information
6+
* $Notice: See LICENSE.txt for modification and distribution information
77
* Copyright (c) 2016 by Shen, Jen-Chieh $
88
*/
99
using UnityEngine;
@@ -13,7 +13,7 @@
1313
namespace JCSUnity
1414
{
1515
/// <summary>
16-
/// Simulate swim action in 2d.
16+
/// Action does the AI swim action in 2D.
1717
/// </summary>
1818
public class JCS_2DSwimAction
1919
: JCS_AIAction

Assets/JCSUnity/Scripts/Actions/2D/AI/AIMoveAction/JCS_2DWalkAction.cs

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* $Date: $
44
* $Revision: $
55
* $Creator: Jen-Chieh Shen $
6-
* $Notice: See LICENSE.txt for modification and distribution information
6+
* $Notice: See LICENSE.txt for modification and distribution information
77
* Copyright (c) 2016 by Shen, Jen-Chieh $
88
*/
99
using UnityEngine;
@@ -13,7 +13,7 @@
1313
namespace JCSUnity
1414
{
1515
/// <summary>
16-
/// Simulate the walk action by the character itself.
16+
/// Action does the AI walk action in 2D.
1717
/// </summary>
1818
[RequireComponent(typeof(JCS_CharacterControllerInfo))]
1919
[RequireComponent(typeof(JCS_VelocityInfo))]
@@ -38,14 +38,12 @@ public enum Status
3838

3939
private JCS_VelocityInfo mVelocityInfo = null;
4040

41+
4142
[Header("** Runtime Varaibles (JCS_2DWalkAction) **")]
4243

43-
[Tooltip("Speed of the action. (walk action)")]
44+
[Tooltip("Speed of the action.")]
4445
[SerializeField]
45-
private float mWalkSpeed = 10;
46-
47-
48-
[Header("** Activate Variables **")]
46+
private float mWalkSpeed = 10.0f;
4947

5048
[Tooltip("Possibility to walk LEFT way.")]
5149
[SerializeField] [Range(0.0f, 100.0f)]
@@ -64,7 +62,7 @@ [SerializeField] [Range(0.0f, 100.0f)]
6462
private float mPossibility = 80.0f;
6563

6664

67-
[Header("** Time Settings **")]
65+
[Header("** Time Settings (JCS_2DWalkAction) **")]
6866

6967
[Tooltip("Time to do one walk.")]
7068
[SerializeField] [Range(0.0f, 10.0f)]
@@ -74,7 +72,7 @@ [SerializeField] [Range(0.0f, 10.0f)]
7472
[SerializeField] [Range(0.0f, 3.0f)]
7573
private float mAdjustTimeZone = 1.5f;
7674

77-
// time to record down the real time to do one walk
75+
// time to record down the real time to do one walk
7876
// action after we calculate the real time.
7977
private float mRealTimeZone = 0;
8078

@@ -91,16 +89,15 @@ [SerializeField] [Range(0.0f, 3.0f)]
9189
[SerializeField]
9290
private bool mStartRandomWalkSpeed = false;
9391

94-
[Tooltip(@"Addition value to the walk speed. For
92+
[Tooltip(@"Addition value to the walk speed. For
9593
instance value 5, will generate -5 ~ 5 and add it on to current walk speed.")]
9694
[SerializeField] [Range(1, 10)]
9795
private float mRandomWalkSpeedRange = 5;
9896

9997

10098
[Header("** Track Effect (JCS_2DWalkAction) **")]
10199

102-
[Tooltip(@"Check weather the this object get mad or not. If
103-
the get mad will start tracking the object that make this object mad.")]
100+
[Tooltip("If get mad will start tracking the object that make this object mad.")]
104101
[SerializeField]
105102
private bool mMadEffect = true;
106103

@@ -111,7 +108,7 @@ [SerializeField] [Range(1, 10)]
111108

112109
[Header("** Optional Settings (JCS_2DWalkAction) **")]
113110

114-
[Tooltip("Plz fill this is there is animation going on to this game object.")]
111+
[Tooltip("Live object animation.")]
115112
[SerializeField]
116113
private JCS_2DLiveObjectAnimator mLiveObjectAnimator = null;
117114

@@ -133,7 +130,7 @@ [SerializeField] [Range(1, 10)]
133130
public float RecordSpeedY { get { return this.mVelocityInfo.RecordSpeed.y; } set { this.mVelocityInfo.RecordSpeedY = value; } }
134131
public float RecordSpeedZ { get { return this.mVelocityInfo.RecordSpeed.z; } set { this.mVelocityInfo.RecordSpeedZ = value; } }
135132

136-
// Track Effects
133+
// Track Effects
137134
public bool MadEffect { get { return this.mMadEffect; } set { this.mMadEffect = value; } }
138135

139136
//========================================
@@ -171,7 +168,7 @@ private void Update()
171168
// Public Functions
172169

173170
/// <summary>
174-
/// Calculate the possiblity and see if do the walk action.
171+
/// Do the walk action depends on possibility.
175172
/// </summary>
176173
public void WalkByPossiblity()
177174
{
@@ -182,7 +179,7 @@ public void WalkByPossiblity()
182179
return;
183180

184181
// start the algorithm to see if we
185-
// find the direction to do,
182+
// find the direction to do,
186183
// if not it will just go randomly.
187184
WalkDirectionPossibility();
188185
}
@@ -195,18 +192,18 @@ public void WalkDirectionPossibility()
195192
{
196193
// direction we are going to use next.
197194
Status direction = Status.IDLE;
198-
195+
199196

200197
// if is already get attack do the mad effect.
201198
if (mMadEffect && mAttackRecorder != null)
202199
{
203200
Transform lastAttacker = mAttackRecorder.LastAttacker;
204201

205-
// if the last attacker does not exist,
202+
// if the last attacker does not exist,
206203
// do nothing.
207204
if (lastAttacker != null)
208205
{
209-
// if does exist, start following
206+
// if does exist, start following
210207
// the attacker.
211208
if (lastAttacker.position.x < this.transform.position.x)
212209
direction = Status.LEFT;
@@ -239,7 +236,7 @@ public void WalkDirectionPossibility()
239236
direction = Status.LEFT;
240237
++resultCounter;
241238
}
242-
239+
243240
if (rightPossiblity < mToRight)
244241
{
245242
// success to do right
@@ -259,21 +256,21 @@ public void WalkDirectionPossibility()
259256
/// <summary>
260257
/// Sometimes if the algorithm cannot find which direction to go.
261258
/// Just use the function instead of keep finding the direction.
262-
///
259+
///
263260
/// For example, all three possiblity (Idle, Left, Right)
264-
/// can be set to 100 percent. Than it will always have to
261+
/// can be set to 100 percent. Than it will always have to
265262
/// possiblity of direction to go, which mean the object could
266263
/// not decide which direction to go.
267264
/// </summary>
268265
public void WalkRandomly()
269266
{
270267
int result = JCS_Random.Range(-1, 1 + 1);
271-
268+
272269
WalkByStatus(result);
273270
}
274271

275272
/// <summary>
276-
///
273+
/// Walk depends on the status.
277274
/// </summary>
278275
/// <param name="direction"></param>
279276
public void WalkByStatus(int direction)
@@ -282,7 +279,7 @@ public void WalkByStatus(int direction)
282279
}
283280

284281
/// <summary>
285-
///
282+
/// Walk depends on the status.
286283
/// </summary>
287284
/// <param name="status"></param>
288285
public void WalkByStatus(Status status)
@@ -364,7 +361,7 @@ private void DoWalk()
364361
}
365362

366363
/// <summary>
367-
/// Algorithm to calculate the time to do
364+
/// Algorithm to calculate the time to do
368365
/// walk action include direction.
369366
/// </summary>
370367
private void ResetTimeZone()

0 commit comments

Comments
 (0)