Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

material Array setter

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MaterialArraySetter : MonoBehaviour {

    public Material Material1;

    void Start ()
    {
        Material[] materialsArray = GetComponent<Renderer>().materials;
        materialsArray[1] = Material1;
        GetComponent<Renderer>().materials = materialsArray;

    }

}
Comment

PREVIOUS NEXT
Code Example
Csharp :: DataTable GetErrors 
Csharp :: c# nunit initialize variables 
Csharp :: Xamarin Forms iOS Picker done 
Csharp :: how to remove all controls from panel c# 
Csharp :: scroll two divs simultaneously site:stackoverflow.com 
Csharp :: function documentation c# exception 
Csharp :: how to do if statement based on date in asp net c# 
Csharp :: unity generate random offset position around a gameobject 
Csharp :: ef core save keyless entity 
Csharp :: MVC Razor check for postback 
Csharp :: c# get first and last day of current month 
Csharp :: unity wrap around value 
Csharp :: array hw exercise 
Csharp :: C# Create Swiss QR-Bill API 
Csharp :: Game of two stack c# 
Csharp :: NetConnectionDispatch 
Csharp :: wpf string to byte array 
Csharp :: unity c# script for movement left and right 
Csharp :: httprequestmessage with authorization .net 5 
Csharp :: convert excel to datatable without xml configuration 
Csharp :: Cursor Button Lock and Area limitation 
Csharp :: unity button hover 
Csharp :: if statement to check if a time is between two times c# 
Csharp :: satisfactory controller support 
Csharp :: c# summary angle brackets 
Csharp :: linq get values is not in other table 
Csharp :: how to change samesite=lax to samesite=none in asp.net 
Csharp :: f# set function how to ignore duplicates 
Csharp :: IdentityServer vs JWT vs OAuth? 
Csharp :: user input in c# 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =