Skip to content

Commit

Permalink
fix: Reveal event API
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jul 30, 2023
1 parent 74a111e commit b3e2516
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/Actions/3D/AI/JCS_3DWalkAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void Awake()

this.mAdjustTimeTrigger = this.GetComponent<JCS_AdjustTimeTrigger>();

mAdjustTimeTrigger.actions = DoAI;
mAdjustTimeTrigger.onAction = DoAI;

this.mStartingPosition = this.transform.position;
}
Expand Down
14 changes: 7 additions & 7 deletions Assets/JCSUnity/Scripts/Actions/JCS_AdjustTimeTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class JCS_AdjustTimeTrigger : MonoBehaviour
/* Variables */

// action to trigger if the time is reached.
public EmptyFunction actions = null;
public EmptyFunction onAction = null;

[Separator("Check Variables (JCS_AdjustTimeTrigger)")]

Expand Down Expand Up @@ -62,15 +62,15 @@ public class JCS_AdjustTimeTrigger : MonoBehaviour

[Tooltip("Event that will be triggered.")]
[SerializeField]
private UnityEvent mUnityEvents = null;
private UnityEvent mOnAction = null;

/* Setter & Getter */

public bool Active { get { return this.mActive; } set { this.mActive = value; } }
public float TimeZone { get { return this.mTimeZone; } set { this.mTimeZone = value; } }
public float AdjustTimeZone { get { return this.mAdjustTimeZone; } set { this.mAdjustTimeZone = value; } }
public JCS_DeltaTimeType DeltaTimeType { get { return this.mDeltaTimeType; } set { this.mDeltaTimeType = value; } }
public UnityEvent UnityEvents { get { return this.mUnityEvents; } set { this.mUnityEvents = value; } }
public UnityEvent OnAction { get { return this.mOnAction; } set { this.mOnAction = value; } }

/* Functions */

Expand Down Expand Up @@ -109,11 +109,11 @@ private void DoAction()
return;

// active actions.
if (actions != null)
actions.Invoke();
if (onAction != null)
onAction.Invoke();

if (mUnityEvents != null)
mUnityEvents.Invoke();
if (mOnAction != null)
mOnAction.Invoke();

mDidAction = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/Actions/JCS_RandomTweenerAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void Awake()
this.mAdjustTimeTrigger = this.GetComponent<JCS_AdjustTimeTrigger>();

// set effect function pointer.
this.mAdjustTimeTrigger.actions = TargetNewVectorValue;
this.mAdjustTimeTrigger.onAction = TargetNewVectorValue;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void Awake()
this.mLookAtAction = this.GetComponent<JCS_3DLookAtAction>();
this.mAdjustTimerTrigger = this.GetComponent<JCS_AdjustTimeTrigger>();

this.mAdjustTimerTrigger.actions = DoPath;
this.mAdjustTimerTrigger.onAction = DoPath;

#if UNITY_EDITOR
if (mPoints.Count == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void Awake()
JCS_Debug.LogWarning("Path action with 0 path point is not valid");
#endif

mAdjustTimerTrigger.actions = DoPath;
mAdjustTimerTrigger.onAction = DoPath;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void Awake()
this.m2DAnimator = this.GetComponent<JCS_2DAnimator>();
this.mAdjustTimeTrigger = this.GetComponent<JCS_AdjustTimeTrigger>();

this.mAdjustTimeTrigger.actions = RandomPlayAnimationInAnimator;
this.mAdjustTimeTrigger.onAction = RandomPlayAnimationInAnimator;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/GameObject/2D/JCS_2DLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void Awake()
this.mAlphaObject = this.GetComponent<JCS_AlphaObject>();
this.mAdjustTimeTrigger = this.GetComponent<JCS_AdjustTimeTrigger>();

this.mAdjustTimeTrigger.actions = DoFade;
this.mAdjustTimeTrigger.onAction = DoFade;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Assets/JCSUnity/Scripts/GameObject/3D/JCS_3DLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void Awake()
this.mValueTweener.set_float = SetLight_Range;
this.mValueTweener.get_float = GetLight_Range;

this.mAdjustTimerTrigger.actions = DoRange;
this.mAdjustTimerTrigger.onAction = DoRange;
}

private void SetLight_Range(float newVal) { this.mLight.range = newVal; }
Expand Down
2 changes: 2 additions & 0 deletions Assets/JCSUnity/Scripts/UI/Button/System/JCS_ActionButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class JCS_ActionButton : JCS_Button

/* Setter & Getter */

public UnityEvent OnAction { get { return this.mOnAction; } set { this.mOnAction = value; } }

/* Functions */

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class JCS_ActionGamePadButton : JCS_GamepadButton

/* Setter & Getter */

public UnityEvent OnAction { get { return this.mOnAction; } set { this.mOnAction = value; } }

/* Functions */

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Assets/JCSUnity/Scripts/UI/Button/System/JCS_ToggleButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public bool Active
}
}
}
public UnityEvent OnAction { get { return this.mOnAction; } set { this.mOnAction = value; } }
public UnityEvent OffAction { get { return this.mOffAction; } set { this.mOffAction = value; } }

/* Functions */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public bool Active
}
}
}
public UnityEvent OnAction { get { return this.mOnAction; } set { this.mOnAction = value; } }
public UnityEvent OffAction { get { return this.mOffAction; } set { this.mOffAction = value; } }

/* Functions */

Expand Down

0 comments on commit b3e2516

Please sign in to comment.