public void ChangeState(eAnimationType type) { commandList.Enqueue(type); if (currentCommand == currentState) { UpdateCommand(); } }
private void UpdateCommand() { if (commandList.Count > 0) { currentCommand = commandList.Dequeue(); if (currentCommand != currentState) { animator.SetTrigger(currentCommand.ToString()); } } }
public void UseAbility(eAnimationType animationType, GridCell target) { Turn(unit.currentLocation, target); switch (animationType) { case eAnimationType.SPECIAL_1: animator.SetTrigger("Special 1"); break; } }
public float GetAnimTime(eAnimationType type) { SpriteAnimationInfo animInfo = null; if (GetAnimationInfo(type, out animInfo)) { float time = (float)animInfo.spriteInfoArray.Length * (animInfo.animSpeed); return(time); } return(0); }
private bool GetAnimationInfo(eAnimationType type, out SpriteAnimationInfo animInfo) { animInfo = null; for (int i = 0; i < spriteAnimInfoArray.Length; i++) { if (spriteAnimInfoArray[i].animType.Equals(type)) { animInfo = spriteAnimInfoArray[i]; break; } } return(animInfo != null); }
public void PlayAnimation(eAnimationType type, MotionClearCB motionClearCB, params object[] param) { SpriteAnimationInfo animInfo = null; if (GetAnimationInfo(type, out animInfo)) { if (selectType.Equals(type) && animInfo.isLoop) { return; } StopAllCoroutines(); selectType = type; if (animSp.isActiveAndEnabled) { StartCoroutine(Play(animInfo, motionClearCB, param)); } } }
public WalkTask(string name, TaskScope scope, Vector3 position, float timeLim, float priority, bool isinterruptible, int urgencyLevel, Func <bool> onDoneFunction, eAnimationType type, List <TaskBase> followUpTasks) : this(name, scope, position, timeLim, priority, isinterruptible, urgencyLevel, onDoneFunction, type) { this.followUpTasks = followUpTasks; }
public WalkTask(string name, TaskScope scope, Vector3 position, float timeLim, float priority, bool isinterruptible, int urgencyLevel, Func <bool> onDoneFunction, eAnimationType type) : this(name, scope, position, timeLim, priority, isinterruptible, urgencyLevel, onDoneFunction) { this.workAnimationType = type; }
public TaskBase(string name, TaskScope scope, Transform transform, float timeLim, float prio, float workTime, bool isinterruptible, int urgency, Func <bool> OnDoneFunction, eAnimationType type, InteractableObject interObject, List <TaskBase> followUpTasks) : this(name, scope, transform, timeLim, prio, workTime, isinterruptible, urgency, OnDoneFunction, type, interObject) { this.followUpTasks = followUpTasks; }
public TaskBase(string name, TaskScope scope, Transform transform, float timeLim, float prio, float workTime, bool isinterruptible, int urgency, Func <bool> OnDoneFunction, eAnimationType type) : this(name, scope, transform, timeLim, prio, workTime, isinterruptible, urgency, OnDoneFunction) { this.workAnimationType = type; }
public void SetCurrentState(eAnimationType selectedState) { currentState = selectedState; UpdateCommand(); }
public XmlLayoutAnimation(AttributeDictionary attributes) { if (attributes.ContainsKey("type")) { type = (eAnimationType)Enum.Parse(typeof(eAnimationType), attributes["type"]); } if (attributes.ContainsKey("attribute")) { attribute = attributes["attribute"]; } if (attributes.ContainsKey("duration")) { duration = attributes["duration"].ToFloat(); } if (attributes.ContainsKey("animations")) { animations = attributes["animations"].ToClassList(); } if (!attributes.ContainsKey("valueType")) { attributes.Add("valueType", "float"); } switch (attributes["valueType"]) { case "float": valueType = typeof(float); break; case "Vector2": valueType = typeof(Vector2); break; case "Vector3": valueType = typeof(Vector3); break; case "Color": valueType = typeof(Color); break; } if (attributes.ContainsKey("to")) { valueTo = attributes["to"].ChangeToType(valueType); } if (attributes.ContainsKey("from")) { valueFrom = attributes["from"].ChangeToType(valueType); hasValueFrom = true; } if (attributes.ContainsKey("curve")) { curve = attributes["curve"]; } }
public WanderTask(string name, TaskScope scope, Vector3 position, Func <bool> isTaskStillValidFunction, float timeLim, float priority, bool isinterruptible, int urgencyLevel, float waitAroundTime, eAnimationType type, Func <bool> onWorkDoneFunction) : this(name, scope, position, isTaskStillValidFunction, timeLim, priority, isinterruptible, urgencyLevel, waitAroundTime) { this.workAnimationType = type; this.onWorkDonefunction = onWorkDoneFunction; }
public WanderTask(string name, TaskScope scope, Vector3 position, Func <bool> isTaskStillValidFunction, float timeLim, float priority, bool isinterruptible, int urgencyLevel, float waitAroundTime, eAnimationType type, List <TaskBase> followUpTasks) : this(name, scope, position, isTaskStillValidFunction, timeLim, priority, isinterruptible, urgencyLevel, waitAroundTime, type) { this.followUpTasks = followUpTasks; }
public void Init() { selectType = eAnimationType.Type_None; }