示例#1
0
 private void OnDrawGizmos()
 {
     if (m_Calculate && m_Target)
     {
         m_Calculate = false;
         NavMesh.CalculatePath(transform.position, m_Target.position, 1, mPath);
         mAgent.SetDestination(m_Target.position);
     }
     if (mAgent)
     {
         mPath = mAgent.path;
     }
     if (mPath != null)
     {
         Vector3[] ps = mPath.corners;
         Gizmos.color = Color.cyan;
         for (int i = 1; i < ps.Length; i++)
         {
             Gizmos.DrawLine(ps[i - 1], ps[i]);
             GizmosUtil.MarkInScene(ps[i], 20, 0);
         }
     }
     if (mAgent)
     {
         Gizmos.color = Color.green;
         GizmosUtil.MarkInScene(mAgent.nextPosition, 30, 0);
     }
 }
示例#2
0
        protected virtual void OnDrawGizmos()
        {
            Color col = Gizmos.color;

            Gizmos.color = new Color(1f, 0f, 0f, 0.5f);
            GizmosUtil.DrawCircle(transform.position, transform.rotation, engageDistance, teethCount);
            Gizmos.color = new Color(1f, 1f, 0f, 0.5f);
            GizmosUtil.DrawCircle(transform.position, transform.rotation, collisionDistance, teethCount);

            Gizmos.color = new Color(1f, 0.5f, 0f, 0.5f);
            float teethOffsetRadians = teethOffset * Mathf.PI / 180f;
            float rotationOffset     = transform.eulerAngles.z * Mathf.PI / 180f;

            for (int i = 0; i < teethCount; ++i)
            {
                float percent = (float)i / (float)teethCount;
                Gizmos.DrawLine(
                    transform.position + transform.rotation * new Vector3(Mathf.Cos(teethOffsetRadians + Mathf.PI * 2f * percent + rotationOffset) * collisionDistance,
                                                                          Mathf.Sin(teethOffsetRadians + Mathf.PI * 2f * percent + rotationOffset) * collisionDistance,
                                                                          0f),
                    transform.position + transform.rotation * new Vector3(Mathf.Cos(teethOffsetRadians + Mathf.PI * 2f * percent + rotationOffset) * engageDistance,
                                                                          Mathf.Sin(teethOffsetRadians + Mathf.PI * 2f * percent + rotationOffset) * engageDistance,
                                                                          0f));
            }

            Gizmos.color = col;
        }
示例#3
0
        private void OnSceneGUI(SceneView sceneView)
        {
            if (!mEnabled || mLocal)
            {
                return;
            }
            mPos = sceneView.camera.transform.position;
            //mPos = Handles.PositionHandle(mPos, Quaternion.identity);
            if (mTex)
            {
                Vector3 right = sceneView.camera.transform.right;
                Vector3 up    = sceneView.camera.transform.up;
                right *= mTex.width * 0.5f * GizmosUtil.FactorFromSceneViewPixel(null, mPos);
                up    *= mTex.height * 0.5f * GizmosUtil.FactorFromSceneViewPixel(null, mPos);

                Handles.Label(mPos - right + up, mTex);
            }
            else
            {
                Color c = Color.yellow;
                c.a           = 0.5f;
                Handles.color = c;
                //Handles.SphereHandleCap(1, mPos, Quaternion.identity, 30 * GizmosUtil.FactorFromSceneViewPixel(null, mPos),EventType.repaint);
                Handles.Label(mPos, "<b>Cubemap Center</b>", mStyle);
            }
        }
示例#4
0
    protected virtual void OnDrawGizmos()
    {
        switch (type)
        {
        case Type.BOX:
            Gizmos.matrix  = base.transform.localToWorldMatrix;
            Gizmos.matrix *= Matrix4x4.TRS(center, Quaternion.Euler(rotation), scale);
            Gizmos.color   = Color.black;
            Gizmos.DrawSphere(Vector3.zero, 0.005f);
            Gizmos.DrawWireCube(Vector3.zero, Vector3.one);
            Gizmos.color = new Color(1f, 0f, 0f, 0.2f);
            Gizmos.DrawCube(Vector3.zero, Vector3.one);
            Gizmos.color  = Color.white;
            Gizmos.matrix = Matrix4x4.identity;
            break;

        case Type.CAPSULE:
            Gizmos.matrix  = base.transform.localToWorldMatrix;
            Gizmos.matrix *= Matrix4x4.TRS(center, Quaternion.Euler(rotation), Vector3.one);
            Gizmos.color   = Color.black;
            Gizmos.DrawSphere(Vector3.zero, 0.005f);
            GizmosUtil.DrawWireCapsuleY(Vector3.zero, scale.x, scale.y);
            Gizmos.color  = Color.white;
            Gizmos.matrix = Matrix4x4.identity;
            break;
        }
    }
示例#5
0
    private void OnDrawGizmos()
    {
        if (p1 == null || p2 == null)
        {
            return;
        }

        line.P1 = p1.transform.position.XZ();
        line.P2 = p2.transform.position.XZ();

        GizmosUtil.Push();

        Gizmos.color = color;
        Gizmos.DrawSphere(p1.position, 0.1f);
        Gizmos.DrawSphere(p2.position, 0.1f);


        var col = color;

        if (lineObj != null)
        {
            Vector2?intersectPoint = line.IntersectWith(lineObj.line);
            if (intersectPoint != null)
            {
                col          = Color.red;
                Gizmos.color = col;
                Gizmos.DrawSphere(intersectPoint.Value.ToXZ(), 0.1f);
            }
        }

        GizmosUtil.DrawLine(line, col);

        GizmosUtil.Pop();
    }
示例#6
0
    private void OnDrawGizmos()
    {
        GizmosUtil.Push();

        rect.UpdateCenter(transform.position.XZ());


        var col = color;

        if (pointObj != null && rect.ContainPoint(pointObj.point))
        {
            col = Color.red;
        }
        else if (circleObj != null)
        {
            var ex_rect = rect.Expand(circleObj.circle.Radius, circleObj.circle.Radius);
            GizmosUtil.DrawRect(ex_rect, Color.green);
            if (circleObj.circle.IntersectWith(rect))
            {
                col = Color.red;
            }
        }
        else if (fandObj != null && rect.IntersectWith(fandObj.fan))
        {
            col = Color.red;
        }

        GizmosUtil.DrawRectSolid(rect, col);
        GizmosUtil.Pop();
    }
示例#7
0
 private void OnDrawGizmosSelected()
 {
     Gizmos.color  = Color.yellow;
     Gizmos.matrix = base.transform.localToWorldMatrix;
     GizmosUtil.DrawSemiCircle(200f);
     Gizmos.DrawWireCube(this.bounds.center, this.bounds.size);
 }
示例#8
0
    private void DrawPointGizmos()
    {
        if (fan.Length <= 0f)
        {
            return;
        }
        var col = color;

        if (pointObj != null && fan.ContainPoint(pointObj.point))
        {
            col = Color.red;
        }
        else if (rectObj != null && fan.IntersectWith(rectObj.rect))
        {
            col = Color.red;
        }
        else if (circleObj != null && fan.IntersectWith(circleObj.circle))
        {
            col = Color.red;
        }



        GizmosUtil.DrawFan(fan, col, mesh);
    }
    protected void OnDrawGizmos()
    {
        bool        flag       = false;
        Vector3     a          = Vector3.get_zero();
        IEnumerator enumerator = ((Component)this).get_transform().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Vector3 position = ((Transform)enumerator.Current).get_position();
                if (flag)
                {
                    Gizmos.set_color(new Color(0.5f, 0.5f, 0.5f, 1f));
                    GizmosUtil.DrawWirePath(a, position, 0.5f * this.Width);
                }
                a    = position;
                flag = true;
            }
        }
        finally
        {
            (enumerator as IDisposable)?.Dispose();
        }
    }
示例#10
0
        protected override void OnDrawGizmos(RenderContext ctx)
        {
            Initialize(ctx);
            var cellMatrix = (CellMatrix)ctx.Data;

            cellMatrix.ForEach(cell => GizmosUtil.DrawCell(cellMatrix, cell));
        }
 private void OnDrawGizmosSelected()
 {
     Gizmos.set_color(Color.get_yellow());
     Gizmos.set_matrix(((Component)this).get_transform().get_localToWorldMatrix());
     GizmosUtil.DrawSemiCircle(200f);
     Gizmos.DrawWireCube(((Bounds) ref this.bounds).get_center(), ((Bounds) ref this.bounds).get_size());
 }
示例#12
0
 private void OnDrawGizmosSelected()
 {
     Gizmos.set_matrix(((Component)this).get_transform().get_localToWorldMatrix());
     Gizmos.set_color(Color.get_green());
     Gizmos.DrawLine(Vector3.get_zero(), Vector3.op_Multiply(Vector3.get_forward(), 1f));
     GizmosUtil.DrawWireCircleZ(Vector3.op_Multiply(Vector3.get_forward(), 0.0f), 0.2f);
     Gizmos.DrawIcon(((Component)this).get_transform().get_position(), "light_circle_green.png", false);
 }
示例#13
0
 private void OnDrawGizmos()
 {
     GizmosUtil.Push();
     fan.Center  = transform.position.XZ();
     fan.Forward = transform.forward.XZ().normalized;
     DrawPointGizmos();
     GizmosUtil.Pop();
 }
 private void OnDrawGizmosSelected()
 {
     Gizmos.matrix = base.transform.localToWorldMatrix;
     Gizmos.color  = Color.green;
     Gizmos.DrawLine(Vector3.zero, Vector3.forward * 1f);
     GizmosUtil.DrawWireCircleZ(Vector3.forward * 0f, 0.2f);
     Gizmos.DrawIcon(base.transform.position, "light_circle_green.png", false);
 }
示例#15
0
    public void OnDrawGizmos()
    {
        Color color = Gizmos.color;

        Gizmos.color = Color.green;
        GizmosUtil.DrawWireCircleY(base.transform.position, radius);
        Gizmos.color = color;
    }
示例#16
0
 private void OnDrawGizmos()
 {
     point = transform.position.XZ();
     GizmosUtil.Push();
     Gizmos.color = color;
     Gizmos.DrawSphere(point.ToXZ(), 0.05f);
     GizmosUtil.Pop();
 }
示例#17
0
    void OnDrawGizmos()
    {
        LineSegment target = new LineSegment(p1, p2);
        float       centerOfMassDistance = (rb.worldCenterOfMass - rb.position).magnitude;
        Vector2     targetCenterOfMass   = p1 + (p2 - p1).normalized * centerOfMassDistance;

        Gizmos.DrawLine(p1, p2);
        GizmosUtil.DrawConstantWidthSphere(targetCenterOfMass, .01f);
    }
示例#18
0
        private void OnDrawGizmos()
        {
            foreach (var VARIABLE in CharacterInfos)
            {
//                if(VARIABLE.characterInfo==null)
//                    continue;
                Gizmos.color = VARIABLE.color;
                GizmosUtil.DrawSign(VARIABLE.position, signalSize);
            }
        }
示例#19
0
 protected void OnDrawGizmosSelected()
 {
     if (this.Radius == 0f)
     {
         this.Radius = this.extents.x;
     }
     Gizmos.color = new Color(0.5f, 0.5f, 0.5f, 1f);
     GizmosUtil.DrawWireCircleY(base.transform.position, this.Radius);
     GizmosUtil.DrawWireCircleY(base.transform.position, this.Radius - this.Fade);
 }
示例#20
0
    public static void DrawWirePath(Vector3 a, Vector3 b, float thickness)
    {
        GizmosUtil.DrawWireCircleY(a, thickness);
        GizmosUtil.DrawWireCircleY(b, thickness);
        Vector3 vector3  = (b - a).normalized;
        Vector3 vector31 = Quaternion.Euler(0f, 90f, 0f) * vector3;

        Gizmos.DrawLine(b + (vector31 * thickness), a + (vector31 * thickness));
        Gizmos.DrawLine(b - (vector31 * thickness), a - (vector31 * thickness));
    }
示例#21
0
    private void OnDrawGizmos()
    {
        Gizmos.color = Color.black;
        Gizmos.DrawLine(startPosition.position, endPosition.position);

        Vector3 midline = Vector3.Lerp(startPosition.position, endPosition.position, 0.5f);

        GizmosUtil.DrawArrow(midline, midline + transform.forward * normalRayLength);
//		Gizmos.DrawLine(midline, midline + transform.forward * normalRayLength);
    }
示例#22
0
    private void OnDrawGizmosSelected()
    {
        Gizmos.color = Color.red;
        GizmosUtil.DrawPoint((Vector2)transform.position + eastHand);
        GizmosUtil.DrawPoint((Vector2)transform.position + westHand);
        GizmosUtil.DrawPoint((Vector2)transform.position + northPoint);
        GizmosUtil.DrawPoint((Vector2)transform.position + southPoint);

        Gizmos.DrawWireSphere(transform.position + (Vector3)twoHandedMidPoint, radius);
    }
示例#23
0
    public static void DrawWirePath(Vector3 a, Vector3 b, float thickness)
    {
        GizmosUtil.DrawWireCircleY(a, thickness);
        GizmosUtil.DrawWireCircleY(b, thickness);
        Vector3 vector3_1 = Vector3.op_Subtraction(b, a);
        Vector3 vector3_2 = Quaternion.op_Multiply(Quaternion.Euler(0.0f, 90f, 0.0f), ((Vector3) ref vector3_1).get_normalized());

        Gizmos.DrawLine(Vector3.op_Addition(b, Vector3.op_Multiply(vector3_2, thickness)), Vector3.op_Addition(a, Vector3.op_Multiply(vector3_2, thickness)));
        Gizmos.DrawLine(Vector3.op_Subtraction(b, Vector3.op_Multiply(vector3_2, thickness)), Vector3.op_Subtraction(a, Vector3.op_Multiply(vector3_2, thickness)));
    }
示例#24
0
 protected void OnDrawGizmosSelected()
 {
     if ((double)this.Radius == 0.0)
     {
         this.Radius = (float)this.extents.x;
     }
     Gizmos.set_color(new Color(0.5f, 0.5f, 0.5f, 1f));
     GizmosUtil.DrawWireCircleY(((Component)this).get_transform().get_position(), this.Radius);
     GizmosUtil.DrawWireCircleY(((Component)this).get_transform().get_position(), this.Radius - this.Fade);
 }
示例#25
0
 private void OnDrawGizmosSelected()
 {
     Gizmos.matrix = transform.localToWorldMatrix;
     Gizmos.color  = Color.cyan * 0.5f;
     for (int i = 0; i < mEmojiBtns.Count; i++)
     {
         var btn = mEmojiBtns[i];
         GizmosUtil.DrawWiredCube(btn.rect.center, btn.rect.size);
     }
 }
示例#26
0
    public static void DrawBounds(Transform transform)
    {
        Bounds     bounds     = transform.GetBounds(true, false, true);
        Vector3    vector3    = transform.lossyScale;
        Quaternion quaternion = transform.rotation;
        Vector3    vector31   = transform.position + (quaternion * Vector3.Scale(vector3, bounds.center));
        Vector3    vector32   = Vector3.Scale(vector3, bounds.size);

        GizmosUtil.DrawCube(vector31, vector32, quaternion);
        GizmosUtil.DrawWireCube(vector31, vector32, quaternion);
    }
    public void OnDrawGizmos()
    {
        Color color = Color.magenta;

        color.a      = 0.25f;
        Gizmos.color = color;
        GizmosUtil.DrawCircleY(base.transform.position, 6f);
        color.a      = 1f;
        Gizmos.color = color;
        GizmosUtil.DrawWireCircleY(base.transform.position, 6f);
    }
示例#28
0
    public static void DrawBounds(Transform transform)
    {
        Bounds     bounds     = transform.GetBounds(true, false, true);
        Vector3    lossyScale = transform.get_lossyScale();
        Quaternion rotation   = transform.get_rotation();
        Vector3    pos        = Vector3.op_Addition(transform.get_position(), Quaternion.op_Multiply(rotation, Vector3.Scale(lossyScale, ((Bounds) ref bounds).get_center())));
        Vector3    size       = Vector3.Scale(lossyScale, ((Bounds) ref bounds).get_size());

        GizmosUtil.DrawCube(pos, size, rotation);
        GizmosUtil.DrawWireCube(pos, size, rotation);
    }
示例#29
0
    private void DrawGizmos()
    {
        Vector3    vector3    = base.transform.lossyScale;
        Quaternion quaternion = base.transform.rotation;
        Vector3    vector31   = base.transform.position + (quaternion * Vector3.Scale(vector3, this.Center));
        Vector3    vector32   = Vector3.Scale(vector3, this.Size);

        Gizmos.color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
        GizmosUtil.DrawCube(vector31, vector32, quaternion);
        GizmosUtil.DrawWireCube(vector31, vector32, quaternion);
    }
    public void OnDrawGizmos()
    {
        Color magenta = Color.get_magenta();

        magenta.a = (__Null)0.25;
        Gizmos.set_color(magenta);
        GizmosUtil.DrawCircleY(((Component)this).get_transform().get_position(), 6f);
        magenta.a = (__Null)1.0;
        Gizmos.set_color(magenta);
        GizmosUtil.DrawWireCircleY(((Component)this).get_transform().get_position(), 6f);
    }