private void InitAnimMgr() { if (UiAnimMgr.s_initialized) { Debug.Log("Warning: AnimMgr already initialized."); return; } this.m_parentObj = new GameObject(); this.m_parentObj.name = "UiAnimMgr Parent"; this.m_additiveMaterial = (Resources.Load("Materials/UiAdditive") as Material); this.m_blendMaterial = (Resources.Load("Materials/UiBlend") as Material); this.m_animData = new Dictionary <string, UiAnimMgr.AnimData>(); TextAsset[] array = Resources.LoadAll <TextAsset>("UiAnimations"); uint num = 0u; while ((ulong)num < (ulong)((long)array.Length)) { UiAnimMgr.AnimData animData = new UiAnimMgr.AnimData(); animData.m_sourceData = array[(int)((UIntPtr)num)]; animData.m_animName = array[(int)((UIntPtr)num)].name; animData.m_activeObjects = new List <GameObject>(); animData.m_availableObjects = new Stack <GameObject>(); this.m_animData.Add(array[(int)((UIntPtr)num)].name, animData); GameObject gameObject = this.CreateAnimObj(array[(int)((UIntPtr)num)].name, true); gameObject.SetActive(false); gameObject.transform.SetParent(this.m_parentObj.transform); num += 1u; } this.m_idIndex = 0; UiAnimMgr.s_initialized = true; }
private void InitAnimMgr() { unsafe { if (UiAnimMgr.s_initialized) { Debug.Log("Warning: AnimMgr already initialized."); return; } this.m_parentObj = new GameObject() { name = "UiAnimMgr Parent" }; this.m_additiveMaterial = Resources.Load("Materials/UiAdditive") as Material; this.m_blendMaterial = Resources.Load("Materials/UiBlend") as Material; this.m_animData = new Dictionary <string, UiAnimMgr.AnimData>(); TextAsset[] textAssetArray = Resources.LoadAll <TextAsset>("UiAnimations"); for (uint i = 0; (ulong)i < (long)((int)textAssetArray.Length); i++) { UiAnimMgr.AnimData animDatum = new UiAnimMgr.AnimData() { m_sourceData = textAssetArray[i], m_animName = textAssetArray[i].name, m_activeObjects = new List <GameObject>(), m_availableObjects = new Stack <GameObject>() }; this.m_animData.Add(textAssetArray[i].name, animDatum); GameObject gameObject = this.CreateAnimObj(textAssetArray[i].name, true); gameObject.SetActive(false); gameObject.transform.SetParent(this.m_parentObj.transform); } this.m_idIndex = 0; UiAnimMgr.s_initialized = true; } }
public TextAsset GetSourceData(string key) { UiAnimMgr.AnimData animData = null; this.m_animData.TryGetValue(key, out animData); if (animData == null) { return(null); } return(animData.m_sourceData); }