Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity game sleep on hit

public void StartSleep(float duration)
{
  StartCoroutine(HitSleep(duration));
}

IEnumerator HitSleep(float duration)
{
  Time.timescale = 0;
  yield return new WaitForSecondsRealtime(duration);
  Time.timescale = 1;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: percentage in c# 
Csharp :: asp.net core 3.1: cast jObject to dictionary<string,string 
Csharp :: Convert Newtonsoft.Json.Linq.JArray to type System.Collections.Generic 
Csharp :: c# debug console log 
Csharp :: c# require administrator permissions 
Csharp :: c# repeat string x times 
Csharp :: custom editor unity 
Csharp :: c sharp gun shooting 
Csharp :: even number checker in c# 
Csharp :: unity rotate around pivot c# 
Csharp :: c# download file 
Csharp :: q# hello world 
Csharp :: how to convert a bitmap to a base64 string c# xamarin universal 
Csharp :: add dynamically buttons in loop with events winform c# 
Csharp :: unity keep rotating object 
Csharp :: get random from list c# 
Csharp :: unity c# class addition syntax 
Csharp :: how to turn off sprite renderer in unity 
Csharp :: C# define a block as text 
Csharp :: generate a random number in c# 
Csharp :: how to add a delay in csharp 
Csharp :: c# set int infinity 
Csharp :: set label position winforms 
Csharp :: get enum int by name 
Csharp :: c# display a variable to a text gameobject 
Csharp :: unity read from text file 
Csharp :: unity c# delay function 
Csharp :: stack to string c# 
Csharp :: c# choose first n elements from list 
Csharp :: c# dictionary first 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =