コード例 #1
0
    private void OnDrawGizmos()
    {
        //serverState
        Gizmos.color = color1;
        Vector3 serverPos = serverState.Position;

        Gizmos.DrawWireCube(serverPos, size1);
        if (serverState.IsMoving)
        {
            DebugGizmoUtils.DrawArrow(serverPos + Vector3.right / 3, serverState.Direction.Vector * serverState.Speed);
            DebugGizmoUtils.DrawText(serverState.Speed.ToString(), serverPos + Vector3.right, 15);
        }

        //serverTargetState
        Gizmos.color = color2;
        Vector3 serverTargetPos = serverTargetState.Position;

        Gizmos.DrawWireCube(serverTargetPos, size2);
        if (serverTargetState.IsMoving)
        {
            DebugGizmoUtils.DrawArrow(serverTargetPos, serverTargetState.Direction.Vector * serverTargetState.Speed);
            DebugGizmoUtils.DrawText(serverTargetState.Speed.ToString(), serverTargetPos + Vector3.down, 15);
        }

        //clientState
        Gizmos.color = color3;
        Vector3 pos = clientState.Position;

        Gizmos.DrawWireCube(pos, size3);
        if (clientState.IsMoving)
        {
            DebugGizmoUtils.DrawArrow(pos + Vector3.left / 3, clientState.Direction.Vector * clientState.Speed);
            DebugGizmoUtils.DrawText(clientState.Speed.ToString(), pos + Vector3.left, 15);
        }
    }
コード例 #2
0
ファイル: MonoPipe.cs プロジェクト: ewy0/unitystation
        void OnDrawGizmos()
        {
            Gizmos.color = Color.white;
            DebugGizmoUtils.DrawText(pipeData.mixAndVolume.Density().ToString(), transform.position, 10);
            Gizmos.color = Color.magenta;
            if (pipeData.Connections.Directions[0].Bool)
            {
                var Toues = transform.position;
                Toues.y += 0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }

            if (pipeData.Connections.Directions[1].Bool)
            {
                var Toues = transform.position;
                Toues.x += 0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }

            if (pipeData.Connections.Directions[2].Bool)
            {
                var Toues = transform.position;
                Toues.y += -0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }

            if (pipeData.Connections.Directions[3].Bool)
            {
                var Toues = transform.position;
                Toues.x += -0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }
        }
コード例 #3
0
    private void OnDrawGizmos()
    {
        Gizmos.color = Color;
        BoundsInt bounds = MetaTileMap.GetWorldBounds();

        DebugGizmoUtils.DrawText(gameObject.name, bounds.max, 11, 5);
        DebugGizmoUtils.DrawRect(bounds);
    }
コード例 #4
0
 void OnDrawGizmos()
 {
     if (Application.isEditor && Application.isPlaying)
     {
         //shows calcualted facing, even during matrix rotations
         Gizmos.color = Color.red;
         DebugGizmoUtils.DrawArrow(transform.position, CalculateFacing());
     }
 }
コード例 #5
0
    private void OnDrawGizmosSelected()
    {
        Gizmos.color = Color.green;

        if (Application.isEditor && !Application.isPlaying)
        {
            DebugGizmoUtils.DrawArrow(transform.position, CurrentDirection.ToLocalVector3());
        }
        else
        {
            DebugGizmoUtils.DrawArrow(transform.position, CurrentDirection.ToLocalVector3());
        }
    }
コード例 #6
0
ファイル: Matrix.cs プロジェクト: ktndrnl/unitystation
    private void OnDrawGizmos()
    {
        Gizmos.color = Color;

        if (metaTileMap == null)
        {
            metaTileMap = GetComponent <MetaTileMap>();
        }

        BoundsInt bounds = MetaTileMap.GetWorldBounds();

        DebugGizmoUtils.DrawText(gameObject.name, bounds.max, 11, 5);
        DebugGizmoUtils.DrawRect(bounds);
    }
コード例 #7
0
 private void OnDrawGizmos()
 {
     if (IsBeingPulled)
     {
         Gizmos.color = color1;
         DebugGizmoUtils.DrawArrow(transform.position, PulledBy.transform.position - transform.position, 0.1f);
     }
     if (IsBeingPulledClient)
     {
         Gizmos.color = color2;
         Vector3 offPosition = transform.position + offset;
         DebugGizmoUtils.DrawArrow(offPosition, (PulledByClient.transform.position + offset) - offPosition, 0.1f);
     }
 }
コード例 #8
0
                           color7 = DebugTools.HexToColor("ff666655");       //reddish
    private void OnDrawGizmos()
    {
        if (!cnt)
        {
            return;
        }
        //registerTile server pos
        Gizmos.color = color7;
        Vector3 regPosS = rt.WorldPositionServer;

        Gizmos.DrawCube(regPosS, size1);

        //registerTile client pos
        Gizmos.color = color0;
        Vector3 regPosC = rt.WorldPositionClient;

        Gizmos.DrawCube(regPosC, size2);

        //server lerp
        Gizmos.color = color1;
        Vector3 stPos = cnt.ServerLerpState.WorldPosition;

        Gizmos.DrawWireCube(stPos, size1);

        //serverState
        Gizmos.color = color2;
        Vector3 ssPos = cnt.ServerState.WorldPosition;

        Gizmos.DrawWireCube(ssPos, size2);
        DebugGizmoUtils.DrawArrow(ssPos + Vector3.right / 2, cnt.ServerState.Impulse);
        DebugGizmoUtils.DrawText(cnt.ServerState.MatrixId.ToString(), ssPos + Vector3.right / 2 + Vector3.up / 3, 15);

        //predictedState
        Gizmos.color = color3;
        Vector3 predictedState = cnt.PredictedState.WorldPosition;

        Gizmos.DrawWireCube(predictedState, size4);
        DebugGizmoUtils.DrawArrow(predictedState + Vector3.right / 5, cnt.PredictedState.Impulse);
        DebugGizmoUtils.DrawText(cnt.PredictedState.MatrixId.ToString(), predictedState + Vector3.right / 2 + Vector3.up / 6, 15);
//		GizmoUtils.DrawText( cnt.ClientState.Speed.ToString(), clientState + Vector3.right / 1.5f + Vector3.up / 6, 10 );

        //clientState
        Gizmos.color = color4;
        Vector3 clientState = cnt.ClientState.WorldPosition;

        Gizmos.DrawWireCube(clientState, size3);
        DebugGizmoUtils.DrawArrow(clientState + Vector3.right / 5, cnt.ClientState.Impulse);
//		GizmoUtils.DrawText( cnt.PredictedState.MatrixId.ToString(), clientState + Vector3.right / 2 + Vector3.up / 6, 15 );
    }
コード例 #9
0
 private void OnDrawGizmos()
 {
     if (!Application.isPlaying || !IsInitialized)
     {
         return;
     }
     foreach (var intersection in Instance.TrackedIntersections)
     {
         Gizmos.color = Color.red;
         DebugGizmoUtils.DrawRect(intersection.Matrix1.WorldBounds);
         Gizmos.color = Color.blue;
         DebugGizmoUtils.DrawRect(intersection.Matrix2.WorldBounds);
         Gizmos.color = Color.yellow;
         DebugGizmoUtils.DrawRect(intersection.Rect);
     }
 }
コード例 #10
0
    private void OnDrawGizmos()
    {
        if (!Application.isPlaying)
        {         //Showing matrix pivot if game is stopped
            Gizmos.color = color1.WithAlpha(0.6f);
            Gizmos.DrawCube(transform.position, Vector3.one);
            Gizmos.color = color1;
            Gizmos.DrawWireCube(transform.position, Vector3.one);

            DebugGizmoUtils.DrawArrow(transform.position, clientState.FlyingDirection.LocalVector * 2);
            return;
        }

        //serverState
        Gizmos.color = color1;
        Vector3 serverPos = serverState.Position;

        Gizmos.DrawWireCube(serverPos, size1);
        if (serverState.IsMoving)
        {
            DebugGizmoUtils.DrawArrow(serverPos + Vector3.right / 3, serverState.FlyingDirection.LocalVector * serverState.Speed);
            DebugGizmoUtils.DrawText(serverState.Speed.ToString(), serverPos + Vector3.right, 15);
        }

        //serverTargetState
        Gizmos.color = color2;
        Vector3 serverTargetPos = serverTargetState.Position;

        Gizmos.DrawWireCube(serverTargetPos, size2);
        if (serverTargetState.IsMoving)
        {
            DebugGizmoUtils.DrawArrow(serverTargetPos, serverTargetState.FlyingDirection.LocalVector * serverTargetState.Speed);
            DebugGizmoUtils.DrawText(serverTargetState.Speed.ToString(), serverTargetPos + Vector3.down, 15);
        }

        //clientState
        Gizmos.color = color3;
        Vector3 pos = clientState.Position;

        Gizmos.DrawWireCube(pos, size3);
        if (clientState.IsMoving)
        {
            DebugGizmoUtils.DrawArrow(pos + Vector3.left / 3, clientState.FlyingDirection.LocalVector * clientState.Speed);
            DebugGizmoUtils.DrawText(clientState.Speed.ToString(), pos + Vector3.left, 15);
        }
    }
コード例 #11
0
        private void OnDrawGizmos()
        {
            var density = pipeData.mixAndVolume.Density();

            Gizmos.color = Color.white;
            DebugGizmoUtils.DrawText(density.ToString(), transform.position, 10);
            Gizmos.color = Color.magenta;

            Connections InCopy = pipeData.Connections;

            if (Application.isPlaying == false)
            {
                InCopy = pipeData.Connections.Copy();
                int offset = PipeFunctions.GetOffsetAngle(transform.localEulerAngles.z);
                InCopy.Rotate(offset);
            }

            if (InCopy.Directions[0].Bool)
            {
                var Toues = transform.position;
                Toues.y += 0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }

            if (InCopy.Directions[1].Bool)
            {
                var Toues = transform.position;
                Toues.x += 0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }

            if (InCopy.Directions[2].Bool)
            {
                var Toues = transform.position;
                Toues.y += -0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }

            if (InCopy.Directions[3].Bool)
            {
                var Toues = transform.position;
                Toues.x += -0.25f;
                Gizmos.DrawCube(Toues, Vector3.one * 0.08f);
            }
        }
コード例 #12
0
 /// <summary>
 /// If we want to see where the contagion is
 /// </summary>
 void OnDrawGizmos()
 {
     DebugGizmoUtils.DrawText(Sickness.SicknessName, registerTile.WorldPositionServer);
 }
コード例 #13
0
 void OnDrawGizmos()
 {
     Gizmos.color = Color.green;
     DebugGizmoUtils.DrawArrow(transform.position, -transform.up);
 }