override public void NodeUpdate(int currentFrame, float clipTime, AttackBuffer buffer) { if (buffer.ready && (cancelable || currentFrame >= IASA)) { if (currentFrame >= IASA) { MoveNextNode(buffer, allowReEntry: true); return; } else if (cancelable) { MoveNextNode(buffer); return; } } if (currentFrame >= IASA && InputManager.HasHorizontalInput()) { attackGraph.ExitGraph(); return; } if (clipTime >= 1) { attackGraph.ExitGraph(); return; } }
public void Initialize(Animator anim, AttackBuffer buffer, Rigidbody2D rb, AirAttackTracker airAttackTracker) { this.anim = anim; this.buffer = buffer; this.rb2d = rb; this.airAttackTracker = airAttackTracker; }
public void Initialize(Animator anim, AttackBuffer buffer, Rigidbody2D rb, AirAttackTracker airAttackTracker) { this.anim = anim; this.buffer = buffer; this.rb2d = rb; this.airAttackTracker = airAttackTracker; this.playerController = anim.GetComponent <PlayerController>(); }
override public void NodeUpdate(int currentFrame, float clipTime, AttackBuffer buffer) { if (buffer.ready && (currentFrame >= IASA || cancelable)) { MoveNextNode(buffer); } else if (clipTime >= 1) { attackGraph.ExitGraph(); } }
protected void MoveNextNode(AttackBuffer buffer, bool allowReEntry = false) { CombatNode next = GetNextNode(buffer); if (next != null) { attackGraph.MoveNode(next); return; } if (allowReEntry) { attackGraph.EnterGraph(null); } }
override public CombatNode GetNextNode(AttackBuffer buffer) { CombatNode next = null; if (speedBarrier > 0 && (Mathf.Abs(attackGraph.rb2d.velocity.x) >= speedBarrier)) { next = MatchAttackNode(buffer, speedLinks, portListName: "speedLinks"); } if (next == null) { next = MatchAttackNode(buffer, links); } return(next); }
// directional attacks are prioritized in order, then the first any-directional link is used protected CombatNode MatchAttackNode(AttackBuffer buffer, AttackLink[] attackLinks, string portListName = "links") { directionalLinks.Clear(); anyDirectionNode = null; for (int i = 0; i < attackLinks.Length; i++) { AttackLink link = attackLinks[i]; if (link.type == buffer.type && buffer.HasDirection(link.direction)) { CombatNode next = GetPort(portListName + " " + i).Connection.node as CombatNode; if (next.Enabled()) { if (link.direction != AttackDirection.ANY) { directionalLinks.Add(new Tuple <AttackLink, CombatNode>(link, next)); } else if (anyDirectionNode == null) { anyDirectionNode = next; } } } } if (directionalLinks.Count > 0) { return(directionalLinks[0].Item2); } if (anyDirectionNode != null) { return(anyDirectionNode); } return(null); }
virtual public CombatNode GetNextNode(AttackBuffer buffer) { return(MatchAttackNode(buffer, this.links)); }
virtual public void NodeUpdate(int currentFrame, float clipTime, AttackBuffer buffer) { }