public int ResolveDriver(IReadOnlyReanimatorState previousState, ReanimatorState nextState, int size) { if (size == 0) { return(0); } string driverName = string.IsNullOrEmpty(name) ? guid : name; if (percentageBased) { float floatDriverValue = Mathf.Clamp01(previousState.GetFloat(driverName)); if (floatDriverValue < 1) { return(Mathf.FloorToInt(floatDriverValue * size)); } return(size - 1); } int driverValue = previousState.Get(driverName) % size; if (autoIncrement) { nextState.Set(driverName, (driverValue + 1) % size); } return(driverValue); }
public virtual void ApplyToRenderer( ReanimatorState previousState, ReanimatorState nextState, SpriteRenderer renderer ) { nextState.Merge(drivers); renderer.sprite = sprite; renderer.flipX = previousState.ShouldFlip(); }
public void ApplyToRenderer( ReanimatorState previousState, ReanimatorState nextState, SpriteRenderer renderer ) { nextState.Merge(drivers); renderer.sprite = previousState.ShouldFlip() ? spriteLeft : sprite; renderer.flipX = false; }
public void ApplyToRenderer(ReanimatorState previousState, ReanimatorState nextState, SpriteRenderer renderer) { }
protected void AddTrace(ReanimatorState nextState) { #if UNITY_EDITOR nextState.AddTrace(this); #endif }
public abstract TerminationNode Resolve(IReadOnlyReanimatorState previousState, ReanimatorState nextState);
public override ICel ResolveCel(IReadOnlyReanimatorState previousState, ReanimatorState nextState) { nextState.Merge(drivers); return(cels[controlDriver.ResolveDriver(previousState, nextState, cels.Length)]); }
public override TerminationNode Resolve(IReadOnlyReanimatorState previousState, ReanimatorState nextState) { AddTrace(nextState); nextState.Merge(drivers); return(this); }
public override TerminationNode Resolve(IReadOnlyReanimatorState previousState, ReanimatorState nextState) { AddTrace(nextState); var node = next.Resolve(previousState, nextState); if (!_map.ContainsKey(node)) { return(node); } var overrideNode = _map[node]; #if UNITY_EDITOR nextState.AddTrace(overrideNode); #endif return(overrideNode); }
public override TerminationNode Resolve(IReadOnlyReanimatorState previousState, ReanimatorState nextState) { AddTrace(nextState); nextState.Merge(drivers); return(nodes[controlDriver.ResolveDriver(previousState, nextState, nodes.Length)] .Resolve(previousState, nextState)); }
public abstract ICel ResolveCel(IReadOnlyReanimatorState previousState, ReanimatorState nextState);