public virtual void OnTriggerEnter(Collider other) { if (other.gameObject.tag == Tags.characterBlocking) { BlockSkill otherBlockSkill = other.gameObject.GetComponent <BlockSkill> (); if (otherBlockSkill != blockSkill) { if (otherBlockSkill.character.chooseBlockDirection) { Directions3D newDirection = otherBlockSkill.direction; if (newDirection != Directions3D.top && newDirection != Directions3D.bottom) { ChangeDirection(newDirection); } else { ChangeDirection(DirectionsChanges3D.GetOpositeDirection(moveToDirection3D.direction)); } } else { ChangeDirection(); } } } }
public virtual void ChangeDirection() { if (action == CharacterActionsEnum.run) { RunEnd(); } if (changeDirectionToBack) { moveToDirection3D.ChangeDirection(DirectionsChanges3D.RandomDirectionGrounded(moveToDirection3D.direction)); } else { moveToDirection3D.ChangeDirection(DirectionsChanges3D.RandomDirectionGrounded90Degrees(moveToDirection3D.direction)); } transform.position = new Vector3(Mathf.Round(transform.position.x), transform.position.y, Mathf.Round(transform.position.z)); }
public void ClockWise() { direction = DirectionsChanges3D.Get90ClockwiseDirection(character.moveToDirection3D.direction); }