Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,20 @@ public ColliderButtonEventData.InputButton activeButton
}

private void Start()
{
CacheResetPoses();
}

// Updates the resetPoses with the current effectTarget poses
private void CacheResetPoses()
{
resetPoses = new RigidPose[effectTargets.Length];
for (int i = 0; i < effectTargets.Length; ++i)
{
resetPoses[i] = new RigidPose(effectTargets[i]);
}
}

#if UNITY_EDITOR
protected virtual void OnValidate()
{
Expand Down Expand Up @@ -77,6 +84,7 @@ public void OnColliderEventPressEnter(ColliderButtonEventData eventData)
{
if (eventData.button == m_activeButton && pressingEvents.Add(eventData) && pressingEvents.Count == 1)
{
CacheResetPoses();
buttonObject.localPosition += buttonDownDisplacement;
}
}
Expand Down