/* * public void OnEnable () { * DK_UMACrowdObj = GameObject.Find("UMACrowd"); * _DK_UMACrowd = DK_UMACrowdObj.gameObject.GetComponent< DK_UMACrowd >(); * _DK_UMACrowd.generateUMA = false; * _DK_UMACrowd.generateLotsUMA = false; * _DK_UMACrowd.UMAGenerated = true; * umaDirtyList.Clear(); * } */ public void Awake() { _DKUMAGenerator = GameObject.Find("DKUMAGenerator").GetComponent <DKUMAGenerator>(); DK_UMACrowdObj = GameObject.Find("DKUMACrowd"); if (DK_UMACrowdObj) { _DK_UMACrowd = DK_UMACrowdObj.gameObject.GetComponent <DK_UMACrowd>(); } #if UNITY_EDITOR if (_DKUMAGenerator.usePRO && !UnityEditorInternal.InternalEditorUtility.HasPro()) { // Debug.LogWarning("You might need to disable usePRO option in the Setup tab of DK UMA Editor window."); _DKUMAGenerator.usePRO = false; } else { _DKUMAGenerator.usePRO = true; } #endif List <string> tmplist = new List <string>(); tmplist.Add("_MainTex"); tmplist.Add("_BumpTex"); textureNameList = tmplist.ToArray(); // _DK_UMACrowd.generateUMA = false; // _DK_UMACrowd.generateLotsUMA = false; // _DK_UMACrowd.UMAGenerated = true; // umaDirtyList.Clear(); _DKUMAGenerator.maxMeshUpdates = 1; if (_DKUMAGenerator.atlasResolution == 0) { _DKUMAGenerator.atlasResolution = 256; } umaGeneratorCoroutine = new DK_RPG_SelfGeneratorCoroutine(); // if(!textureMerge){ // textureMerge = GameObject.Find ("TextureMerge").GetComponent("DKTextureMerge") as DKTextureMerge; if (!textureMerge) { Transform tempTextureMerger = Instantiate(_DKUMAGenerator.textureMergePrefab, Vector3.zero, Quaternion.identity) as Transform; tempTextureMerger.name = "TextureMerge"; textureMerge = tempTextureMerger.GetComponent("DKTextureMerge") as DKTextureMerge; textureMerge.transform.parent = transform; textureMerge.gameObject.SetActive(false); } // } //Garbage Collection hack var mb = (System.GC.GetTotalMemory(false) / (1024 * 1024)); if (mb < 10) { byte[] data = new byte[10 * 1024 * 1024]; data[0] = 0; data[10 * 1024 * 1024 - 1] = 0; } }
/* * public void OnEnable () { * DK_UMACrowdObj = GameObject.Find("UMACrowd"); * _DK_UMACrowd = DK_UMACrowdObj.gameObject.GetComponent< DK_UMACrowd >(); * _DK_UMACrowd.generateUMA = false; * _DK_UMACrowd.generateLotsUMA = false; * _DK_UMACrowd.UMAGenerated = true; * umaDirtyList.Clear(); * } */ public void Awake() { /* try { * Destroy ( textureMerge.gameObject ); * }catch (MissingReferenceException){}*/ DK_UMACrowdObj = GameObject.Find("DKUMACrowd"); if (DK_UMACrowdObj) { _DK_UMACrowd = DK_UMACrowdObj.gameObject.GetComponent <DK_UMACrowd>(); } #if UNITY_EDITOR if (usePRO && !UnityEditorInternal.InternalEditorUtility.HasPro()) { // Debug.LogWarning("You might need to disable usePRO option in the Setup tab of DK UMA Editor window."); usePRO = false; } // else usePRO = true; #endif // _DK_UMACrowd.generateUMA = false; // _DK_UMACrowd.generateLotsUMA = false; // _DK_UMACrowd.UMAGenerated = true; // umaDirtyList.Clear(); maxMeshUpdates = 1; if (atlasResolution == 0) { atlasResolution = 256; } umaGeneratorCoroutine = new DKUMAGeneratorCoroutine(); if (!textureMerge && DK_UMACrowd.GeneratorMode == "Preset") { GameObject obj = GameObject.Find("TextureMerge"); if (obj) { textureMerge = obj.GetComponent("DKTextureMerge") as DKTextureMerge; } if (!textureMerge) { Transform tempTextureMerger = Instantiate(textureMergePrefab, Vector3.zero, Quaternion.identity) as Transform; tempTextureMerger.name = "TextureMerge"; textureMerge = tempTextureMerger.GetComponent("DKTextureMerge") as DKTextureMerge; textureMerge.transform.parent = transform; textureMerge.gameObject.SetActive(false); } } else { } //Garbage Collection hack var mb = (System.GC.GetTotalMemory(false) / (1024 * 1024)); if (mb < 10) { byte[] data = new byte[10 * 1024 * 1024]; data[0] = 0; data[10 * 1024 * 1024 - 1] = 0; } }