private GameObject process(ObjectPosition op) { if (op is LightPosition) { GameObject lgo = new GameObject(); //#if UNITY_EDITOR addCDR(op, lgo); //#endif LightPosition lp = (LightPosition)op; lgo.transform.SetParent(meshRoot.transform); lgo.transform.localScale = new Vector3(op.scale, op.scale, op.scale); lgo.transform.localPosition = op.min; lgo.transform.localRotation = op.qut; Light light = lgo.AddComponent <Light>(); light.type = LightType.Point; light.color = new Color(lp.r, lp.g, lp.b); light.intensity = lp.range; light.shadows = LightShadows.Hard; return(lgo); } GameObject go = GameObject.Instantiate(telaraObjectPrefab, meshRoot.transform); #if UNITY_EDITOR addCDR(op, go); #endif if (!op.visible || (op.nifFile != null && op.nifFile.Contains("30meter.nif"))) { go.tag = "invisible"; go.SetActive(false); invisibleObjects.Add(go); } string name = op.nifFile; Assets.RiftAssets.AssetDatabase.RequestCategory category = Assets.RiftAssets.AssetDatabase.RequestCategory.NONE; if (name.Contains("_terrain_") || name.Contains("ocean_chunk")) { if (name.Contains("_terrain_")) { category = Assets.RiftAssets.AssetDatabase.RequestCategory.GEOMETRY; } } telara_obj tobj = go.GetComponent <telara_obj>(); tobj.setProps(category); //go.transform.SetParent(meshRoot.transform); tobj.setFile(name); go.name = name; go.transform.localScale = new Vector3(op.scale, op.scale, op.scale); go.transform.localPosition = op.min; go.transform.localRotation = op.qut; triggerLoad(tobj); return(go); }
public void setProps(Assets.RiftAssets.AssetDatabase.RequestCategory cat) { this.cat = cat; }