public static GameObject SetCurrentPrefab(PrefabInfo[] info, GameObject currentPrefab, Transform tranfrm, out int monthStart) { GameObject.Destroy(currentPrefab); int indx = ObjectChanger.GetIndex(info); PrefabInfo prefabInfo = info [indx]; currentPrefab = prefabInfo.prefab; currentPrefab = GameObject.Instantiate(currentPrefab, tranfrm.position, tranfrm.rotation) as GameObject; currentPrefab.transform.localScale = tranfrm.localScale; monthStart = prefabInfo.monthStart; return(currentPrefab); }
void SetCurrentTextures() { ObjectChanger.SetCurrentTexture(leaves, leafMatNumber, renderer); ObjectChanger.SetCurrentTexture(bark, barkMatNumber, renderer); }
void monthUpdate() { ObjectChanger.SetCurrentTexture(backgrounds, 0, renderer); }
// Use this for initialization void Start() { holder = gameObject.GetComponent <ObjectChanger> (); }