Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# infinite clock coroutine loop

int count = 24;   //starts at midnight
string hour;
int time_scale_delay = 1;  //seconds

//infinite loop/clock from the start function with 24 second intervals 
IEnumerator Start()
{
  while(true)
  {
    yield return new WaitForSeconds(time_scale_delay);
    
    //reset timer
    if(count == 25)
      count = 1;
    
    //AM or PM
    if(count == 12)
      hour = (count + "th hour PM");
              if(count == 24)
              hour = ((count - 12) + "th hour AM");
                      if(count < 12)
                      hour = (count + "th hour AM");
                              if(count > 12 && != 24)
                              hour = ((count - 12) + "th hour PM");
    count + count +1;
   )
     
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity vector3.distance giving nonsensical values 
Csharp :: set active for a seconds 
Csharp :: c# print array 
Csharp :: shutdown system c# 
Csharp :: check c# date for 0001/01/01 
Csharp :: how to copy a file in c# 
Csharp :: nepali phone number regex 
Csharp :: how to log out of unity asset store 
Csharp :: how to be like bill gates 
Csharp :: c# memorystream to byte array 
Csharp :: xamarin overlay 
Csharp :: unity how to rotate something to point to something else 
Csharp :: c# process start 
Csharp :: c# add 1 
Csharp :: how to convert a number to 2 decimal places in c# 
Csharp :: C# fix formatting 
Csharp :: detect keypress c# 
Csharp :: remove all letters from string c# 
Csharp :: exit a method c# 
Csharp :: unity mouse movement 
Csharp :: message uwp c# 
Csharp :: unity destroy all children 
Csharp :: c# console beep sounds 
Csharp :: how to make teleporter in unity 
Csharp :: how to freeze x and y position in rb2d with code unity 
Csharp :: repeat 10 timesw c# 
Csharp :: programmatically write bash script from c# 
Csharp :: pyqt qtableview get selected row data 
Csharp :: c# generate random number 
Csharp :: c# split a string and return list 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =