protected override void OnDrawActionGizmos() { var op = this.gameObject.transform.position - (this.gameObject.transform.forward * 0.5f); var rotate = this.gameObject.transform.eulerAngles; var direction = Quaternion.Euler(rotate) * Vector3.forward; Gizmos.color = Color.red; MyGizmos.DrawFOV(op, direction, FOV, Range); }
//关于 OnDrawGizmos 请看 QuadtreeBaiscObject private void OnDrawGizmos() { if (!enabled) { return; //在更新到正式第二版之后才发现OnDrawGizmos就算是停用了组件也会运行,于是加上这个组件停用直接返回 } Gizmos.color = Color.green; MyGizmos.DrawCircle(transform.position, 10, 20); //Mygizmos是一个自写的类,位置在 QuadtreeCollider 里,这个方法是画圆圈的 }
private void OnDrawGizmos() { if (!enabled) { return; } Gizmos.color = _checkCollision ? Color.yellow * 0.8f : Color.green * 0.8f; MyGizmos.DrawCircle(transform.position, _radius * Mathf.Max(transform.lossyScale.x, transform.lossyScale.y), 60); }
void DrawBorder() { Gizmos.color = Color.yellow; Vector3 upperRight = new Vector3(StandardValue.bulletMoveBorder.right, StandardValue.bulletMoveBorder.top, 0); Vector3 lowerRight = new Vector3(StandardValue.bulletMoveBorder.right, StandardValue.bulletMoveBorder.bottom, 0); Vector3 lowerLeft = new Vector3(StandardValue.bulletMoveBorder.left, StandardValue.bulletMoveBorder.bottom, 0); Vector3 upperLeft = new Vector3(StandardValue.bulletMoveBorder.left, StandardValue.bulletMoveBorder.top, 0); MyGizmos.DrawRectangle(upperRight, lowerRight, lowerLeft, upperLeft); }
private void OnDrawGizmos() { if (!enabled) { return; } Gizmos.color = Color.green * 0.8f; MyGizmos.DrawCircle(transform.position, _radius * Mathf.Max(transform.localScale.x, transform.localScale.y), 60); }
void DrawTargetBorder() { Gizmos.color = Color.green; Vector3 upperRight = new Vector3(_targetBorder.right, _targetBorder.top, 0); Vector3 lowerRight = new Vector3(_targetBorder.right, _targetBorder.bottom, 0); Vector3 lowerLeft = new Vector3(_targetBorder.left, _targetBorder.bottom, 0); Vector3 upperLeft = new Vector3(_targetBorder.left, _targetBorder.top, 0); MyGizmos.DrawRectangle(upperRight, lowerRight, lowerLeft, upperLeft); }
void DrawAdjustmentBorder() { Gizmos.color = Color.yellow; Vector3 upperRight = new Vector3(_adjustmentBorder.right, _adjustmentBorder.top, 0); Vector3 lowerRight = new Vector3(_adjustmentBorder.right, _adjustmentBorder.bottom, 0); Vector3 lowerLeft = new Vector3(_adjustmentBorder.left, _adjustmentBorder.bottom, 0); Vector3 upperLeft = new Vector3(_adjustmentBorder.left, _adjustmentBorder.top, 0); MyGizmos.DrawRectangle(upperRight, lowerRight, lowerLeft, upperLeft); }
void DrawMoveBorder() { Gizmos.color = Color.red; Vector3 upperRight = new Vector3(_moveBorder.right, _moveBorder.top, 0); Vector3 lowerRight = new Vector3(_moveBorder.right, _moveBorder.bottom, 0); Vector3 lowerLeft = new Vector3(_moveBorder.left, _moveBorder.bottom, 0); Vector3 upperLeft = new Vector3(_moveBorder.left, _moveBorder.top, 0); MyGizmos.DrawRectangle(upperRight, lowerRight, lowerLeft, upperLeft); }
private void OnDrawGizmosSelected() { var op = this.gameObject.transform.position - (this.gameObject.transform.forward * 0.5f); var rotate = this.gameObject.transform.eulerAngles; var direction = Quaternion.Euler(rotate) * Vector3.forward; Gizmos.color = Color.green; MyGizmos.DrawFOV(op, direction, FOV, Range); Gizmos.color = Color.red; Gizmos.DrawWireSphere(this.gameObject.transform.position, GetAttackDistance()); }
private void OnDrawGizmosSelected() { Gizmos.color = Color.red; MyGizmos.DrawFOV(transform.position + new Vector3(0, 0.5f, 0), transform.forward, FOV, AttackDistance); }
void DrawRadius() { Gizmos.color = Color.yellow * 0.8f; MyGizmos.DrawCircle(transform.position, _radius, 60); }
private void OnDrawGizmosSelected() { MyGizmos.DrawWireCirlce(transform.position, transform.rotation, m_RadiusInner, m_AngularSegments); MyGizmos.DrawWireCirlce(transform.position, transform.rotation, RadiusOuter, m_AngularSegments); }
void DrawRadius() { Gizmos.color = Color.yellow * 0.8f; MyGizmos.DrawCircle(transform.position, _radius, 60); //Mygizmos是一个自写的类,位置在 QuadtreeCollider 里,这个方法是画圆圈的 }