Exemplo n.º 1
0
    // 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;
                }
            }
        }
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
	void Update(){
		PlayerDebug.DrawRay (transform.position, transform.up * indicatorLineLength, Color.white);
		PlayerDebug.DrawCircle(transform.position, GetComponent<CircleCollider2D>().radius,agentColor);
	}
Exemplo n.º 5
0
 void LateUpdate()
 {
     PlayerDebug.DrawLine(target.position, targetPosition, Color.red);
     PlayerDebug.DrawCircle(targetPosition, .125f, Color.red);
 }
Exemplo n.º 6
0
 void LateUpdate()
 {
     PlayerDebug.DrawCircle(transform.position, 0.25f, Color.blue);
 }