TO SQUASH: started menu callback calling
This commit is contained in:
@@ -18,6 +18,8 @@ public class MenuKey : MonoBehaviour
|
||||
|
||||
private bool isTranslating = false;
|
||||
|
||||
private bool triggered = false;
|
||||
|
||||
private float translationElapsed = 0f;
|
||||
|
||||
private float translationStartY = 0f;
|
||||
@@ -95,9 +97,42 @@ public class MenuKey : MonoBehaviour
|
||||
targetRow = row;
|
||||
}
|
||||
|
||||
public void InvokeCallback(int _)
|
||||
public void OpenKey(bool trigger)
|
||||
{
|
||||
callbackHolder.InvokeCallback(currentRow);
|
||||
this.triggered = trigger;
|
||||
animator.ResetTrigger("buttonReleased");
|
||||
animator.SetTrigger("buttonClicked");
|
||||
if (!trigger)
|
||||
animator.SetBool("inButton", true);
|
||||
}
|
||||
|
||||
public void CloseKey()
|
||||
{
|
||||
animator.SetBool("inButton", false);
|
||||
}
|
||||
|
||||
public void ReleaseKey()
|
||||
{
|
||||
animator.ResetTrigger("buttonClicked");
|
||||
animator.SetTrigger("buttonReleased");
|
||||
}
|
||||
|
||||
public void InvokeCallback()
|
||||
{
|
||||
if (!isTranslating)
|
||||
{
|
||||
callbackHolder.InvokeCallback(currentRow);
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerCallback(int _)
|
||||
{
|
||||
if (!isTranslating && triggered)
|
||||
{
|
||||
triggered = false;
|
||||
callbackHolder.InvokeCallback(currentRow);
|
||||
ReleaseKey();
|
||||
}
|
||||
}
|
||||
|
||||
private float EaseOutQuad(float t)
|
||||
|
||||
Reference in New Issue
Block a user