public virtual void ExitHover() { if (CastleManager.showLog) { print("Exit hover: " + gameObject.tag); } hoverState = CastleManager.HoverState.ExitHover; hoverTimer = hoverFloored = 0; StartCoroutine(ExitHoverDelay()); }
public virtual void EnterHover() { if (CastleManager.showLog) { print("Enter hover: " + gameObject.tag); } hoverState = CastleManager.HoverState.EnterHover; hoverTimer = hoverFloored = 0; }
public virtual void Hover() { hoverState = CastleManager.HoverState.Hover; if (hoverFloored < Mathf.FloorToInt(hoverTimer)) { hoverFloored = Mathf.FloorToInt(hoverTimer); if (CastleManager.showLog) { print("Hovering: " + gameObject.tag + " for " + hoverFloored + " seconds"); } } hoverTimer += Time.deltaTime; }
IEnumerator ExitHoverDelay() { yield return(new WaitForEndOfFrame()); hoverState = CastleManager.HoverState.None; }