Exemplo n.º 1
0
        private void OnDrawGizmos()
        {
            if (Astronomy.SunLight == null)
            {
                return;
            }

            if (!Application.isPlaying)
            {
                Astronomy.SunLight.transform.localRotation = Astronomy.Rotation();
            }

            Gizmos.color = Color.blue;
            Gizmos.DrawLine(Astronomy.SunLight.transform.position + (Astronomy.SunLight.transform.forward * Astronomy.Radius * 0.75f), Astronomy.SunLight.transform.position + (Astronomy.SunLight.transform.forward * Astronomy.Radius));
            //Gizmos.DrawLine( Sun.transform.position - ( Sun.transform.forward * Radius * 0.75f ), Sun.transform.position - ( Sun.transform.forward * Radius ) );
            CustomGizmos.Circle(Astronomy.SunLight.transform.position, Astronomy.SunLight.transform.up, Astronomy.Radius);
            CustomGizmos.Arrow(Astronomy.SunLight.transform.position + (Astronomy.SunLight.transform.forward * Astronomy.Radius * 0.75f), Astronomy.SunLight.transform.forward * -2, 10);
            CustomGizmos.HandlesColor(Gizmos.color);
            CustomGizmos.Arrow(0, Astronomy.SunLight.transform.position - (Astronomy.SunLight.transform.forward * Astronomy.Radius), Astronomy.SunLight.transform.rotation, 50);


            if (m_PathPositions.Count > 1000)
            {
                m_PathPositions.RemoveAt(0);
            }

            Vector3 _prior_pos = Vector3.zero;

            foreach (Vector3 _pos in m_PathPositions)
            {
                if (_prior_pos != Vector3.zero)
                {
                    Gizmos.DrawLine(_prior_pos, _pos);
                }

                _prior_pos = _pos;
            }
        }