public virtual void OnUpdateWorking() { if (anim.Animator.IsInTransition(0)) { return; } if (clock > bridge.duration) { // Complete the work if time has finished anim.SetTrigger("Work_Completed"); } else if (!Game.stopped) { var factor = clock / bridge.duration; clock += Time.deltaTime; } }
public void Knock(Vector3 dir, float duration) { // Only add CC if wasn't already knocked if (!effects.ContainsKey("Knocked")) { AddCC("Knocked", Locks.All, interrupt: Locks.Dash | Locks.Spells); } else if (knockedCoroutine != null) { StopCoroutine(knockedCoroutine); } anim.SetTrigger("Hit"); knockedCoroutine = StartCoroutine(KnockingTo(dir, duration)); // Let go grabbed object, if any, // in opposite direction of knock if (toy) { toy.Throw(-dir * 5f, owner: this); } }