// Reset to default values. public void Reset() { UpdateMaterials(); for (int i = 0; i < GetGraphCount(); i++) { string m = BocsCyclesShaderConvert.Convert(Smats[i]); m = Regex.Replace(m, "[^a-zA-Z0-9_.:,|=+-;<>/| ]", string.Empty); Nodes[i] = m; } NSync(); BocsCyclesAPI.ObjectDelete(this.gameObject); BocsCyclesAPI.AddMesh(this.gameObject); }
//Dup object protected void Awake() { NSync(); BocsCyclesAPI.AddMesh(this.gameObject); }
private static void StepSync() { if (syncLights.Length > 0) { if (syncLightsIndex < syncLights.Length) { if (syncLights[syncLightsIndex].GetComponent <BocsCyclesSkip>() == null) { if (syncLights[syncLightsIndex].GetComponent <BocsCyclesLight>() == null) { syncLights[syncLightsIndex].gameObject.AddComponent <BocsCyclesLight>(); } else { BocsCyclesAPI.AddLight(syncLights[syncLightsIndex].gameObject); } } syncLightsIndex++; syncCurrent++; return; } } if (syncMeshes.Length > 0) { if (syncMeshesIndex < syncMeshes.Length) { if (syncMeshes[syncMeshesIndex].GetComponent <BocsCyclesSkip>() == null) { if (syncMeshes[syncMeshesIndex].GetComponent <BocsCyclesMaterial>() == null) { syncMeshes[syncMeshesIndex].gameObject.AddComponent <BocsCyclesMaterial>(); } else { BocsCyclesAPI.AddMesh(syncMeshes[syncMeshesIndex].gameObject); } } syncMeshesIndex++; syncCurrent++; return; } } if (syncSkins.Length > 0) { if (syncSkinsIndex < syncSkins.Length) { if (syncSkins[syncSkinsIndex].GetComponent <BocsCyclesSkip>() == null) { if (syncSkins[syncSkinsIndex].GetComponent <BocsCyclesMaterial>() == null) { syncSkins[syncSkinsIndex].gameObject.AddComponent <BocsCyclesMaterial>(); } else { BocsCyclesAPI.AddMesh(syncSkins[syncSkinsIndex].gameObject); } } syncSkinsIndex++; syncCurrent++; return; } } synced = true; }