public override void InstantiateGameObject(Resource res) { base.InstantiateGameObject(res); PrefabLightmapData lm = m_object.GetComponent <PrefabLightmapData>(); if (lm != null) { lm.LoadLightmap(); } GeoPolygon[] list = m_object.GetComponentsInChildren <GeoPolygon>(); for (int i = 0; i < list.Length; i++) { GeoPolygon geo = list[i]; Polygon p = new Polygon(); p.c = geo.transform.position.ToVector2d(); p.isObstacle = true; p.bAirWall = geo.bAirWall; p.Init(geo.GetVertex()); p.active = true; m_polygon.Add(p); PhysicsManager.Inst.Add(p); } //GameObject staticObj = GameObject.Find("Static"); GameObject staticObj = m_object; if (staticObj != null) { //StaticBatchingUtility.Combine(staticObj); StaticBatching(staticObj); } }
static void UseLightmapData(GameObject obj) { PrefabLightmapData pld = obj.GetComponent <PrefabLightmapData>(); if (pld != null) { pld.LoadLightmap(); } }
public static void LoadLightmapInfo() { GameObject go = Selection.activeGameObject; if (go == null) { return; } PrefabLightmapData data = go.GetComponent <PrefabLightmapData>(); if (data == null) { return; } data.LoadLightmap(); EditorUtility.SetDirty(go); }