private async void AdjustShroud(ShroudPreference pref) { await Task.Delay(TimeSpan.FromSeconds(0.1f)); if (!pref.shroudActive) { shroudImg.enabled = false; return; } DoAdjust(); shroudImg.enabled = true; holeMat.SetFloat("_Radius", pref.holeRadius); holeMat.SetFloat("_Shape", pref.holeShape); }
IEnumerator AdjustShroud(ShroudPreference pref) { yield return(YieldHelper.DeciSecond); if (!pref.shroudActive) { shroudImg.enabled = false; yield break; } DoAdjust(); holeMat.SetColor("_Color", pref.shroudColor); holeMat.SetFloat("_Radius", pref.holeRadius); holeMat.SetFloat("_Shape", pref.holeShape); shroudImg.enabled = true; }
IEnumerator AdjustShroud(ShroudPreference pref) { yield return(WaitFor.Seconds(.1f)); if (!pref.shroudActive) { shroudImg.enabled = false; MonitorTarget = false; yield break; } MonitorTarget = true; holeMat.SetColor("_Color", pref.shroudColor); holeMat.SetFloat("_Radius", pref.holeRadius); holeMat.SetFloat("_Shape", pref.holeShape); shroudImg.enabled = true; }