public void LoadSync() { if (string.IsNullOrEmpty(modelRes)) { gameObj = new GameObject(); trans = gameObj.transform; } UnityEngine.Object uobj = BundleMgr.Instance.GetAssetSync(modelRes); gameObj = GameObject.Instantiate <GameObject>(uobj as GameObject); #if UNITY_EDITOR ApplyShader.CheckShader(gameObj).Start(); #endif trans = gameObj.transform; }
private IEnumerator Instant(ulong gcbId, UObj asset) { yield return(null); GameObject go = null; if (null != asset) { go = Instantiate(asset) as GameObject; } #if UNITY_EDITOR ApplyShader.CheckShader(go); #endif FinishInstant(gcbId, go); }
public static ApplyShader CheckShader(Object o) { GameObject go = o as GameObject; if (null != go) { ApplyShader comp = go.GetComponent <ApplyShader>(); if (comp == null) { comp = go.AddComponent <ApplyShader>(); } return(comp); } return(null); }
void Awake() { ApplyShader.CheckShader(blurMaterial); ApplyShader.CheckShader(UIMaterial); }