Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

change color unity over time

void Start() 
{
    // ... your other stuff 

    StartCoroutine(ChangeEngineColour());
}

private IEnumerator ChangeEngineColour()
{
    float tick = 0f;
    while (engineBodyRenderer.material.color != endColor)
    {
        tick += Time.deltaTime * speed;
        engineBodyRenderer.material.color = Color.Lerp(startColor, endColor, tick);
        yield return null;
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: dynamic add event control c# 
Csharp :: irrrtate throught an matrix c# 
Csharp :: serialize xml as array C# 
Csharp :: c# int to string date conversion 
Csharp :: GetComponent<Button().onClick 
Csharp :: how to parse mongo db json in c# 
Csharp :: convert string into float C# 
Csharp :: set request size c# 
Csharp :: ado net execute sql query 
Csharp :: unity create a textbox in inspector 
Csharp :: unity stop physics 
Csharp :: drawing default serializedproperty unity 
Csharp :: unity sprite disappears when using transform.lookat 
Csharp :: vb.net delete folder if exists 
Csharp :: 405 - HTTP verb used to access this page is not allowed 
Csharp :: tilemap shader 
Csharp :: the name scripts does not exist in the current context mvc 5 
Csharp :: faucongz 
Csharp :: display image script unity 
Csharp :: unity find deactivated gameobject 
Csharp :: if or statement c# 
Csharp :: linq c# where condition 
Csharp :: install active directory windows server 2019 powershell 
Csharp :: list view in unity 
Csharp :: array to object c# 
Csharp :: lightbox 
Csharp :: wpf app transparent background with blurred image affect 
Csharp :: create a hash of an XML c# 
Csharp :: selecteditem treeview wpf 
Csharp :: c# nunit assert.contains 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =