Last active
August 29, 2015 14:25
-
-
Save yasuakiohama/4f8654ad01309d664608 to your computer and use it in GitHub Desktop.
CleateShadowColorPlane.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class CleatePlane : MonoBehaviour | |
{ | |
public GameObject shadowColorPlanePrefab; | |
void Start () | |
{ | |
for (int h = 0; h <= 360; h++) { | |
GameObject shadowColorPlane = Instantiate (this.shadowColorPlanePrefab) as GameObject; | |
shadowColorPlane.name = this.shadowColorPlanePrefab.name; | |
shadowColorPlane.transform.SetParent (this.gameObject.transform); | |
shadowColorPlane.GetComponent<Renderer> ().material.SetColor ("_ShadowColor", ColorHSV.FromHsv (h, 255, 255)); | |
shadowColorPlane.transform.position = new Vector3 ((float)h * shadowColorPlane.transform.localScale.x, 0, 0); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment