public override void AbcSetup(AbcAPI.aiObject abcObj, AbcAPI.aiSchema abcSchema) { base.AbcSetup(abcObj, abcSchema); m_Camera = GetOrAddComponent <Camera>(); }
public override void AbcSetup(AbcAPI.aiObject abcObj, AbcAPI.aiSchema abcSchema) { base.AbcSetup(abcObj, abcSchema); AbcAPI.aiPolyMeshGetSummary(abcSchema, ref summary); m_FreshSetup = true; }
public override void AbcSetup(AbcAPI.aiObject abcObj, AbcAPI.aiSchema abcSchema) { base.AbcSetup(abcObj, abcSchema); Light light = GetOrAddComponent <Light>(); // Disable component for now light.enabled = false; }
public virtual void AbcSetup(AbcAPI.aiObject abcObj, AbcAPI.aiSchema abcSchema) { m_AbcObj = abcObj; m_AbcSchema = abcSchema; m_ThisHandle = GCHandle.Alloc(this); IntPtr ptr = GCHandle.ToIntPtr(m_ThisHandle); AbcAPI.aiSchemaSetConfigCallback(abcSchema, ConfigCallback, ptr); AbcAPI.aiSchemaSetSampleCallback(abcSchema, SampleCallback, ptr); }
Mesh AddMeshComponents(AbcAPI.aiObject abc, GameObject gameObject) { Mesh mesh = null; MeshFilter meshFilter = gameObject.GetComponent <MeshFilter>(); bool hasMesh = meshFilter != null && meshFilter.sharedMesh != null && meshFilter.sharedMesh.name.IndexOf("dyn: ") == 0; if (!hasMesh) { mesh = new Mesh { name = "dyn: " + gameObject.name }; mesh.MarkDynamic(); if (meshFilter == null) { meshFilter = gameObject.AddComponent <MeshFilter>(); } meshFilter.sharedMesh = mesh; MeshRenderer renderer = gameObject.GetComponent <MeshRenderer>(); if (renderer == null) { renderer = gameObject.AddComponent <MeshRenderer>(); } #if UNITY_EDITOR Material material = UnityEngine.Object.Instantiate(AbcUtils.GetDefaultMaterial()); material.name = "Material_0"; renderer.sharedMaterial = material; #endif } else { mesh = meshFilter.sharedMesh; } return(mesh); }