Skip to content

Instantly share code, notes, and snippets.

@IshidaGames
Last active March 5, 2020 03:22
Show Gist options
  • Save IshidaGames/e33809b6e3ed1feb7a286e7152cf37a0 to your computer and use it in GitHub Desktop.
Save IshidaGames/e33809b6e3ed1feb7a286e7152cf37a0 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Change : MonoBehaviour {
void Start () {
//アタッチするオブジェクトのRendererのComponentを取得する
Renderer coloring = this.GetComponent<Renderer>();
//RendererのMaterialにランダムな色を入れる
coloring.material.color = new Color(Random.value, Random.value, Random.value, 1.0f); ;
}
void Update () {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment