public void RollOutImmediate() { if (RolledIn == true) { RolledIn = false; SetUnrolledAngle(unrolledAngle); BeforeRollOut?.Invoke(carpet); RollStateChanged?.Invoke(RolledIn, gameObject); } }
public float RollOut(TaskIdentity rollOutIdentity = null) { SoundController.Current.PlayCarpetRollSound(); SoundController.Current.Vibrate(); float duration = 0; if (RolledIn == true) { rollingOut = true; RollOutIdentity = rollOutIdentity; duration = getTimeToRoll(0.1f, 0.5f, !RolledIn); BeforeRollOut?.Invoke(carpet); RollingCoroutine = RollEnumerator(duration, !RolledIn); StartCoroutine(RollingCoroutine); } return(duration); }