// Update is called once per frame void Update() { //Debug //Scales Debug circle to the size of the actual circle drawn float maxDimension = Mathf.Max(transform.lossyScale.x, transform.lossyScale.y); Color c = new Color(0, 0, .5f, .125f); if (triggering) { c = new Color(1f, 0, 0, .125f); } PlayerDebug.DrawCircle(transform.position, circleCollider.radius * maxDimension, c); foreach (SquadUnit su in units) { if (Vector2.Distance(su.unit.transform.position, transform.position) < .1f) { su.unit.GetComponent <Rigidbody2D>().velocity = Vector2.zero; su.unit.transform.position = transform.position; if (isServer) { su.unit.GetComponent <CharacterMovement>().speedMultiplier = 0; su.unit.GetComponent <Rigidbody2D> ().simulated = false; } } } }
void LateUpdate() { //Outer circle Color outerColor = new Color(1f, 0, 0, .25f * timer / maxTime); PlayerDebug.DrawCircle(circlePosition, circleRadius, outerColor); //Inner Circle PlayerDebug.DrawLine(transform.position, target.position, Color.red); PlayerDebug.DrawCircle(target.position, maxDistance / 2f, Color.red); }
protected override void OnDrawGizmos() { //base.OnDrawGizmos(); if (!enabled || target == null) { return; } //Outer circle Color outerColor = new Color(1f, 0, 0, .25f * timer / maxTime); Gizmos.color = outerColor; Gizmos.DrawSphere(circlePosition, circleRadius); PlayerDebug.DrawCircle(circlePosition, circleRadius, outerColor); //Inner circle Gizmos.color = Color.red; Gizmos.DrawSphere(target.position, maxDistance / 2f); }
void Update(){ PlayerDebug.DrawRay (transform.position, transform.up * indicatorLineLength, Color.white); PlayerDebug.DrawCircle(transform.position, GetComponent<CircleCollider2D>().radius,agentColor); }
void LateUpdate() { PlayerDebug.DrawLine(target.position, targetPosition, Color.red); PlayerDebug.DrawCircle(targetPosition, .125f, Color.red); }
void LateUpdate() { PlayerDebug.DrawCircle(transform.position, 0.25f, Color.blue); }