public void LoadProxy() { Animation animation = new AnimationProxy(); animation.dessine(); animation.clic(); animation.dessine(); }
void testProxy() { Animation animation = new AnimationProxy(); animation.dessine(); animation.clic(); animation.dessine(); }
public void LoadProxy() { IAnimation animation = new AnimationProxy(); animation.Dessine(); animation.Clic(); animation.Dessine(); }
public static string GetPlayingClipName(AnimationProxy aGroup) { if (aGroup == null) { return(string.Empty); } return(aGroup.CurrentClipName); }
public static string GetPlayingAnimationName(AnimationProxy aGroup) { if (aGroup == null) { return(string.Empty); } return(aGroup.GetPlayingAnimationName()); }
private void OnEditorFireEvent() { if (base.AffectedObject == null) { return; } if (!base.AffectedObject.gameObject.activeSelf) { base.AffectedObject.gameObject.SetActive(true); } this.animationprox = base.AffectedObject.GetComponentInChildren <AnimationProxy>(); if (this.animationprox == null) { LogSystem.LogError(new object[] { "UIPlayAnimEvent.OnEditorFireEvent() ->", base.AffectedObject.name, ": not found animation proxy!" }); return; } string editorAnimationPath = this.animationprox.GetEditorAnimationPath(this.animationName); this.mAnimationClip = (Resources.Load(editorAnimationPath) as AnimationClip); if (!this.mAnimationClip) { Debug.Log("Attempting to play an animation on a GameObject but you haven't given the event an animation clip from USPlayAnimEvent::FireEvent"); return; } Animation animation = base.AffectedObject.GetComponent <Animation>(); if (!animation) { animation = base.AffectedObject.AddComponent <Animation>(); } animation.playAutomatically = false; animation.clip = this.mAnimationClip; animation.AddClip(this.mAnimationClip, this.animationName); animation.wrapMode = this.wrapMode; animation.Play(this.mAnimationClip.name); AnimationState animationState = animation[this.mAnimationClip.name]; if (!animationState) { return; } animationState.speed = this.playbackSpeed; }
public override void FireEvent() { this.animationprox = base.AffectedObject.GetComponentInChildren <AnimationProxy>(); if (this.animationprox == null) { LogSystem.LogWarning(new object[] { "PlayAnimAction ->", base.AffectedObject.name, ": not found animation proxy!" }); return; } if (Instance.Get <SequenceManager>().PlayActionFunc != null) { this.animationprox.mMainClip.strName = this.animationName; this.animationprox.mMainClip.strPath = this.animationprox.GetAnimationPath(this.animationName); Instance.Get <SequenceManager>().PlayActionFunc(this.animationprox, this.animationName, this.playbackSpeed); } }
public void LoadAnimationClipNoPlay(string strAnimationName) { string animationPath = this.GetAnimationPath(strAnimationName); if (string.IsNullOrEmpty(animationPath)) { return; } if (AnimationProxy.monLoadAsset != null) { AnimationProxy.monLoadAsset(animationPath, delegate(object[] args) { AnimationClip animationClip = args[0] as AnimationClip; if (animationClip != null) { this.AddAnimationClip(strAnimationName, animationClip); } }); } }
private void OnGameFireEvent() { if (!base.AffectedObject.gameObject.activeSelf) { base.AffectedObject.gameObject.SetActive(true); } this.animationprox = base.AffectedObject.GetComponentInChildren <AnimationProxy>(); if (this.animationprox == null) { LogSystem.LogError(new object[] { "UIPlayAnimEvent.OnGameFireEvent() ->", base.AffectedObject.name, ": not found animation proxy!" }); return; } if (Instance.Get <SequenceManager>().PlayActionFunc != null) { this.animationprox.mMainClip.strName = this.animationName; this.animationprox.mMainClip.strPath = this.animationprox.GetAnimationPath(this.animationName); Instance.Get <SequenceManager>().PlayActionFunc(this.animationprox, this.animationName, this.playbackSpeed); } }
/// <summary> /// 根据当前出战武学的武器类型重置角色动作 /// </summary> public static AnimationProxy ResetAllActions(GameObject go, List <string> actionNameList, List <string> actionPathList) { AnimationProxy animProxy = go.GetComponent <AnimationProxy>(); if (animProxy) { if (animProxy.mAnimation) { DestroyImmediate(animProxy.mAnimation); } DestroyImmediate(animProxy); } animProxy = go.AddComponent <AnimationProxy>(); animProxy.mAnimations = new AnimationInfo[actionNameList.Count]; AnimationInfo animInfo; AnimationInfo mainAnimInfo = null; for (int i = 0; i < actionNameList.Count; i++) { animInfo = new AnimationInfo(); animInfo.strName = actionNameList[i]; animInfo.strPath = actionPathList[i]; if (animInfo.strName.Equals("idle")) { mainAnimInfo = new AnimationInfo(); mainAnimInfo.strName = actionNameList[i]; mainAnimInfo.strPath = actionPathList[i]; } animProxy.mAnimations[i] = animInfo; } animProxy.mMainClip = mainAnimInfo; animProxy.Awake(); //AddComponent的时候会执行Awake,但没事数据,现在有数据后,需要再次执行下 return(animProxy); }
public override void StopEvent() { this.animationClip = null; this.animationprox = null; }