private static void DrawCylinder(Vector3 p, Vector3 up, float height, float radius) { Vector3 normalized = Vector3.Cross(up, Vector3.one).normalized; Gizmos.matrix = Matrix4x4.TRS(p, Quaternion.LookRotation(normalized, up), new Vector3(radius, height, radius)); RVOController.DrawCircle(new Vector2(0f, 0f), 1f, 0f, 6.28318548f); if (height > 0f) { RVOController.DrawCircle(new Vector2(0f, 1f), 1f, 0f, 6.28318548f); Gizmos.DrawLine(new Vector3(1f, 0f, 0f), new Vector3(1f, 1f, 0f)); Gizmos.DrawLine(new Vector3(-1f, 0f, 0f), new Vector3(-1f, 1f, 0f)); Gizmos.DrawLine(new Vector3(0f, 0f, 1f), new Vector3(0f, 1f, 1f)); Gizmos.DrawLine(new Vector3(0f, 0f, -1f), new Vector3(0f, 1f, -1f)); } }
private void OnDrawGizmos() { if (this.locked) { Gizmos.color = RVOController.GizmoColor * 0.5f; } else { Gizmos.color = RVOController.GizmoColor; } if (this.movementMode == MovementMode.XY) { RVOController.DrawCylinder(base.transform.position, Vector3.forward, 0f, this.radius); } else { RVOController.DrawCylinder(base.transform.position + this.To3D(Vector2.zero, this.center - this.height * 0.5f), this.To3D(Vector2.zero, 1f), this.height, this.radius); } }
void Start() { cam = Camera.main; rb = GetComponent <Rigidbody2D>(); stats = GetComponent <BasicStats>(); headReset = transform.Find("Head Reset"); audioManager = AudioManager.instance; animTimeManager = GameManager.instance.GetComponent <AnimTimeManager>(); gm = GameManager.instance; anim = GetComponent <Animator>(); obstacleMask = LayerMask.GetMask("Walls", "OpenDoors", "ClosedDoors"); AIDestSetter = GetComponent <Pathfinding.AIDestinationSetter>(); AIPath = GetComponent <Pathfinding.AIPath>(); RVOController = GetComponent <Pathfinding.RVO.RVOController>(); CalculateMoveSpeeds(); StartCoroutine(UpdateFootstepSounds()); }
void Awake () { seeker = GetComponent<Seeker>(); controller = GetComponent<CharacterController>(); rvoController = GetComponent<RVOController>(); if ( rvoController != null ) rvoController.enableRotation = false; tr = transform; }
void Awake () { seeker = GetComponent<Seeker>(); controller = GetComponent<CharacterController>(); rvoController = GetComponent<RVOController>(); tr = transform; }
void Start() { controller = GetComponent <Pathfinding.RVO.RVOController>(); }
private void Awake() { this.seeker = base.GetComponent<Seeker>(); this.controller = base.GetComponent<CharacterController>(); this.rvoController = base.GetComponent<RVOController>(); if (this.rvoController != null) { this.rvoController.enableRotation = false; } this.tr = base.transform; }