Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using UnityEngine;
using System.Collections;

public class AutoCreate : MonoBehaviour 
{
	public GameObject plante;
	void Start()
	{
		Material[] mats = Resources.LoadAll<Material>("Planets-Low");
		foreach(Material mat in mats)
		{
			GameObject pla = Instantiate(plante) as GameObject;
			pla.name = mat.name;
			pla.transform.parent = transform;
			pla.GetComponent<MeshRenderer>().GetComponent<Renderer>().material = mat;
		}
	}
}

Commits for Nextrek/3DSpace/Assets/AutoCreate.cs

Diff revisions: vs.
Revision Author Commited Message
168 Diff Diff LMancini picture LMancini Wed 08 Apr, 2015 12:33:35 +0000
112 Diff Diff FMMortaroli picture FMMortaroli Thu 09 Oct, 2014 14:21:59 +0000
107 FMMortaroli picture FMMortaroli Thu 09 Oct, 2014 11:56:46 +0000