public override bool StartAnimation(AnimationMetaData animdata) { if (ActiveAnimationsByAnimCode.ContainsKey(Personality + "nod")) { return(false); } if (PersonalizedAnimations.Contains(animdata.Animation.ToLowerInvariant())) { if (animdata.Animation == "laugh" && ActiveAnimationsByAnimCode.ContainsKey(Personality + "welcome")) { return(false); } animdata = animdata.Clone(); animdata.Animation = Personality + animdata.Animation; animdata.Code = animdata.Animation; animdata.CodeCrc32 = AnimationMetaData.GetCrc32(animdata.Code); if (animdata.Animation != Personality + "idle") { StopAnimation(Personality + "idle"); } } return(base.StartAnimation(animdata)); }
public override bool StartAnimation(string configCode) { if (ActiveAnimationsByAnimCode.ContainsKey(Personality + "nod")) { return(false); } if (PersonalizedAnimations.Contains(configCode.ToLowerInvariant())) { if (configCode == "laugh" && ActiveAnimationsByAnimCode.ContainsKey(Personality + "welcome")) { return(false); } if (configCode != "idle") { StopAnimation(Personality + "idle"); } return(StartAnimation(new AnimationMetaData() { Animation = Personality + configCode, Code = Personality + configCode, BlendMode = EnumAnimationBlendMode.Average, EaseOutSpeed = 10000, EaseInSpeed = 10000 })); } return(base.StartAnimation(configCode)); }
private void SetAnimation(string animCode, float speed) { AnimationMetaData animMeta = null; if (!ActiveAnimationsByAnimCode.TryGetValue(animCode, out animMeta)) { animMeta = new AnimationMetaData() { Code = animCode, Animation = animCode, AnimationSpeed = speed, }; ActiveAnimationsByAnimCode.Clear(); ActiveAnimationsByAnimCode[animMeta.Animation] = animMeta; return; } animMeta.AnimationSpeed = speed; }
public override bool StartAnimation(AnimationMetaData animdata) { if ((animdata.Code == "idle2" || animdata.Code == "laugh") && ActiveAnimationsByAnimCode.ContainsKey(Personality + "welcome")) { return(false); } if (Personality == "formal" || Personality == "rowdy" || Personality == "lazy") { StopAnimation(Personality + "idle"); StopAnimation(Personality + "laugh"); StopAnimation(Personality + "idle2"); } if (PersonalizedAnimations.Contains(animdata.Animation.ToLowerInvariant())) { animdata = animdata.Clone(); animdata.Animation = Personality + animdata.Animation; animdata.Code = animdata.Animation; animdata.CodeCrc32 = AnimationMetaData.GetCrc32(animdata.Code); } return(base.StartAnimation(animdata)); }