Skip to content

Instantly share code, notes, and snippets.

@yasuakiohama
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yasuakiohama/4f8654ad01309d664608 to your computer and use it in GitHub Desktop.
Save yasuakiohama/4f8654ad01309d664608 to your computer and use it in GitHub Desktop.
CleateShadowColorPlane.cs
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