Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

fade image out unity

IEnumerator FadeImage(bool fadeAway)
{
    // fade from opaque to transparent
    if (fadeAway)
    {
        // loop over 1 second backwards
        for (float i = 1; i >= 0; i -= Time.deltaTime)
        {
            // set color with i as alpha
            img.color = new Color(1, 1, 1, i);
            yield return null;
        }
    }
    // fade from transparent to opaque
    else
    {
        // loop over 1 second
        for (float i = 0; i <= 1; i += Time.deltaTime)
        {
            // set color with i as alpha
            img.color = new Color(1, 1, 1, i);
            yield return null;
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: editorfor date format mvc 
Csharp :: how to open website from c# program 
Csharp :: gameobject on click unity 
Csharp :: Unity Children Destroy 
Csharp :: parse datetime c# 
Csharp :: c# Get type with namespace 
Csharp :: C# array of repeated value 
Csharp :: swap two numbers c# 
Csharp :: wpf app how to get all elements which are exposed to script 
Csharp :: unity 3d camera movement script 
Csharp :: c# regex match 
Csharp :: CS0101 
Csharp :: particle system start color 
Csharp :: unity call function from another script 
Csharp :: streamwriter c# 
Csharp :: c# isarray 
Csharp :: c# datagridview change selected row color 
Csharp :: get x and y of mouse uinty 
Csharp :: Convert DataTable to Dictionary in C# 
Csharp :: c# create console for winform 
Csharp :: c# read csv file 
Csharp :: how to flip a character in unity 2d 
Csharp :: linq query to check if record exists 
Csharp :: convert list of tuples to dictionary c# 
Csharp :: asp.net mvc get current url in view 
Csharp :: c# quit button script 
Csharp :: change scale of an object unity 
Csharp :: make variables in c# 
Csharp :: how to get unique list in c# 
Csharp :: And this is how can you deserialize your XML file in your C# code: 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =