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);
        }
    }
Beispiel #2
0
 void OnDrawGizmos()
 {
     if (Application.isEditor && Application.isPlaying)
     {
         //shows calcualted facing, even during matrix rotations
         Gizmos.color = Color.red;
         DebugGizmoUtils.DrawArrow(transform.position, CalculateFacing());
     }
 }
Beispiel #3
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());
        }
    }
Beispiel #4
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);
     }
 }
Beispiel #5
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 );
    }
Beispiel #6
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);
        }
    }
 void OnDrawGizmos()
 {
     Gizmos.color = Color.green;
     DebugGizmoUtils.DrawArrow(transform.position, -transform.up);
 }