/// <summary> /// 清除所有动作引用 /// </summary> public void ClearAnimationClips() { if (mAnimation == null || mActionControlList.Count == 0) { return; } ///清除所有一次性动作 for (int i = 0; i < mActionControlList.Count; i++) { string strActionName = mActionControlList[i]; if (mActionLoadedDict.ContainsKey(strActionName)) { AnimationClip aClip = mActionLoadedDict[strActionName]; mAnimation.RemoveClip(aClip); mActionLoadedDict.Remove(strActionName); DelegateProxy.PopCache(aClip); } } ///清除主动作 if (mAnimation.clip != null) { mAnimation.RemoveClip(mAnimation.clip); DelegateProxy.PopCache(mAnimation.clip); mAnimation.clip = null; } }
public void ClearAnimationClips() { if (this.mAnimation == null || this.mActionControlList.Count == 0) { return; } for (int i = 0; i < this.mActionControlList.Count; i++) { string key = this.mActionControlList[i]; if (this.mActionLoadedDict.ContainsKey(key)) { AnimationClip animationClip = this.mActionLoadedDict[key]; if (animationClip != null) { this.mAnimation.RemoveClip(animationClip); } this.mActionLoadedDict.Remove(key); DelegateProxy.PopCache(animationClip); } } if (this.mAnimation.clip != null && !this.mActionControlList.Contains(this.mAnimation.clip.name)) { this.mAnimation.RemoveClip(this.mAnimation.clip); DelegateProxy.PopCache(this.mAnimation.clip); this.mAnimation.clip = null; } }
private void OnDestroy() { if (this.mainTexture != null) { DelegateProxy.PopCache(this.mainTexture); } if (this.mMat != null) { DelegateProxy.PopCache(this.mMat.mainTexture); DelegateProxy.PopCache(this.mMat); } }
/// <summary> /// 移出动画 /// </summary> void PopAnimationControl() { if (mActionControlList == null || mAnimation == null) { return; } if (mActionControlList.Count > miActionListMaxCount) { string strClipName = mActionControlList[0]; //LogSystem.LogError("PopAnimation -> ", strClipName); mActionControlList.RemoveAt(0); if (mActionLoadedDict.ContainsKey(strClipName)) { mActionLoadedDict.Remove(strClipName); } AnimationClip aClip = mAnimation.GetClip(strClipName); mAnimation.RemoveClip(strClipName); DelegateProxy.PopCache(aClip); aClip = null; } }
private void PopAnimationControl() { if (this.mActionControlList == null || this.mAnimation == null) { return; } if (this.mActionControlList.Count > 5) { string text = this.mActionControlList[0]; this.mActionControlList.RemoveAt(0); if (this.mActionLoadedDict.ContainsKey(text)) { this.mActionLoadedDict.Remove(text); } AnimationClip clip = this.mAnimation.GetClip(text); if (clip != null) { this.mAnimation.RemoveClip(text); DelegateProxy.PopCache(clip); } } }