DrawArrow() public static method

public static DrawArrow ( Vector3 from, Vector3 to, Vector3 ortho ) : void
from Vector3
to Vector3
ortho Vector3
return void
Beispiel #1
0
    private void OnDrawGizmos()
    {
        //serverState
        Gizmos.color = color1;
        Vector3 serverPos = serverState.Position;

        Gizmos.DrawWireCube(serverPos, size1);
        if (serverState.IsMoving)
        {
            GizmoUtils.DrawArrow(serverPos + Vector3.right / 3, serverState.Direction * serverState.Speed);
            GizmoUtils.DrawText(serverState.Speed.ToString(), serverPos + Vector3.right, 15);
        }
        //serverTargetState
        Gizmos.color = color2;
        Vector3 serverTargetPos = serverTargetState.Position;

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

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

        Gizmos.DrawWireCube(pos, size3);
        if (clientState.IsMoving)
        {
            GizmoUtils.DrawArrow(pos + Vector3.left / 3, clientState.Direction * clientState.Speed);
            GizmoUtils.DrawText(clientState.Speed.ToString(), pos + Vector3.left, 15);
        }
    }
    private void OnDrawGizmos()
    {
        if (!cnt)
        {
            return;
        }
        //serverState
        Gizmos.color = color2;
        Vector3 ssPos = cnt.ServerState.WorldPosition;

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

        //registerTile pos
        Gizmos.color = color3;
        Vector3 regPos = rt.WorldPosition;

        Gizmos.DrawWireCube(regPos, size3);

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

        Gizmos.DrawWireCube(clientState, size4);
        GizmoUtils.DrawArrow(clientState + Vector3.right / 5, cnt.ClientState.Impulse);
        GizmoUtils.DrawText(cnt.ClientState.MatrixId.ToString(), clientState + Vector3.right / 2 + Vector3.up / 6, 15);
//		GizmoUtils.DrawText( cnt.ClientState.Speed.ToString(), clientState + Vector3.right / 1.5f + Vector3.up / 6, 10 );
    }
    private void OnDrawGizmos()
    {
        //serverTargetState
        Gizmos.color = color1;
        Vector3 stsPos = serverTargetState.WorldPosition;

        Gizmos.DrawWireCube(stsPos, size1);
        GizmoUtils.DrawArrow(stsPos + Vector3.left / 2, serverTargetState.Impulse);
        GizmoUtils.DrawText(serverTargetState.MoveNumber.ToString(), stsPos + Vector3.left / 4, 15);

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

        Gizmos.DrawWireCube(ssPos, size2);
        GizmoUtils.DrawArrow(ssPos + Vector3.right / 2, serverState.Impulse);
        GizmoUtils.DrawText(serverState.MoveNumber.ToString(), ssPos + Vector3.right / 4, 15);

        //client predictedState
        Gizmos.color = color3;
        Vector3 clientPrediction = predictedState.WorldPosition;

        Gizmos.DrawWireCube(clientPrediction, size3);
        GizmoUtils.DrawArrow(clientPrediction + Vector3.left / 5, predictedState.Impulse);
        GizmoUtils.DrawText(predictedState.MoveNumber.ToString(), clientPrediction + Vector3.left, 15);

        //client playerState
        Gizmos.color = color4;
        Vector3 clientState = playerState.WorldPosition;

        Gizmos.DrawWireCube(clientState, size4);
        GizmoUtils.DrawArrow(clientState + Vector3.right / 5, playerState.Impulse);
        GizmoUtils.DrawText(playerState.MoveNumber.ToString(), clientState + Vector3.right, 15);
    }
        private static void DrawGizmoConnection(IMultitoolSlaveable device, GizmoType type)
        {
            if (PrefabStageUtility.GetCurrentPrefabStage() != null)
            {
                return;                                                                 // Don't show in prefab mode.
            }
            if (type.HasFlag(GizmoType.Selected) || type.HasFlag(GizmoType.Active))
            {
                if (device.Master == null)
                {
                    return;
                }

                Gizmos.color = MasterDeviceInspector.LinkColors.TryGetValue(device.ConType, out var color) ? color : Color.green;
                GizmoUtils.DrawArrow(
                    device.Master.gameObject.transform.position,
                    device.gameObject.transform.position - device.Master.gameObject.transform.position,
                    false);
                Gizmos.DrawSphere(device.Master.gameObject.transform.position, 0.15f);
            }
            else if (type.HasFlag(GizmoType.NonSelected))
            {
                if (device.RequireLink == false || device.Master != null)
                {
                    return;
                }

                string icon = disconnectedGizmoIcons.TryGetValue(device.ConType, out var filename) ? filename : "no-wifi";
                Gizmos.DrawIcon(device.gameObject.transform.position, icon);
            }
        }
Beispiel #5
0
        private void OnDrawGizmos()
        {
            //serverTargetState
            Gizmos.color = color1;
            Gizmos.DrawWireCube(serverTargetState.Position - CustomNetTransform.deOffset, size1);

            //serverState
            Gizmos.color = color2;
            Gizmos.DrawWireCube(serverState.Position - CustomNetTransform.deOffset, size2);

            //client predictedState
            Gizmos.color = color3;
            Vector3 clientPrediction = predictedState.Position - CustomNetTransform.deOffset;

            Gizmos.DrawWireCube(clientPrediction, size3);
            GizmoUtils.DrawArrow(clientPrediction + Vector3.left / 5, predictedState.Impulse);
            GizmoUtils.DrawText(predictedState.MoveNumber.ToString(), clientPrediction + Vector3.left, 15);

            //client playerState
            Gizmos.color = color4;
            Vector3 clientState = playerState.Position - CustomNetTransform.deOffset;

            Gizmos.DrawWireCube(clientState, size4);
            GizmoUtils.DrawArrow(clientState + Vector3.right / 5, playerState.Impulse);
            GizmoUtils.DrawText(playerState.MoveNumber.ToString(), clientState + Vector3.right, 15);
        }
Beispiel #6
0
    private void OnDrawGizmos()
    {
        Bounds bounds = base.GetComponent <BoxCollider>().bounds;

        for (float num = bounds.min.y; num <= bounds.max.y; num += 8f)
        {
            for (float num2 = bounds.min.x; num2 <= bounds.max.x; num2 += 8f)
            {
                GizmoUtils.DrawArrow(new Vector3(num2, num, base.transform.position.z), this.WindDirection());
            }
        }
    }
Beispiel #7
0
 private void OnDrawGizmos()
 {
     if (IsBeingPulled)
     {
         Gizmos.color = color1;
         GizmoUtils.DrawArrow(transform.position, PulledBy.transform.position - transform.position, 0.1f);
     }
     if (IsBeingPulledClient)
     {
         Gizmos.color = color2;
         Vector3 offPosition = transform.position + offset;
         GizmoUtils.DrawArrow(offPosition, (PulledByClient.transform.position + offset) - offPosition, 0.1f);
     }
 }
Beispiel #8
0
        public override void DrawGizmo(MetaDataLayer source, Vector3Int position)
        {
            MetaDataNode node = source.Get(position, false);

            if (node.HasWind)
            {
                var alpha = Mathf.Clamp(node.WindForce / 20, 0.1f, 0.8f);
                GizmoUtils.DrawCube(position, Color.blue, true, alpha);

                Gizmos.color = Color.white;
                GizmoUtils.DrawText($"{node.WindForce:0.#}", LocalToWorld(source, position) + (Vector3)Vector2.down / 4, false);

                GizmoUtils.DrawArrow(position, (Vector2)node.WindDirection / 2);
            }
        }
Beispiel #9
0
        private static void DrawGizmoConnection(IMultitoolMasterable device, GizmoType type)
        {
            DeviceLinker.InitDeviceLists(device.ConType);

            Gizmos.color = LinkColors.TryGetValue(device.ConType, out var color) ? color : Color.green;

            foreach (IMultitoolSlaveable slave in DeviceLinker.Slaves)
            {
                if (slave.Master != device)
                {
                    continue;
                }

                GizmoUtils.DrawArrow(
                    device.gameObject.transform.position,
                    slave.gameObject.transform.position - device.gameObject.transform.position,
                    false);
            }

            Gizmos.DrawSphere(device.gameObject.transform.position, 0.15f);
        }
Beispiel #10
0
    private void OnDrawGizmos()
    {
        //registerTile pos
        Gizmos.color = color0;
        Vector3 regPos = registerTile.WorldPosition;

        Gizmos.DrawCube(regPos, size5);

        //serverState
        Gizmos.color = color1;
        Vector3 stsPos = serverState.WorldPosition;

        Gizmos.DrawWireCube(stsPos, size1);
        GizmoUtils.DrawArrow(stsPos + Vector3.left / 2, serverState.Impulse);
        if (drawMoves)
        {
            GizmoUtils.DrawText(serverState.MoveNumber.ToString(), stsPos + Vector3.left / 4, 15);
        }

        //serverLerpState
        Gizmos.color = color2;
        Vector3 ssPos = serverLerpState.WorldPosition;

        Gizmos.DrawWireCube(ssPos, size2);
        GizmoUtils.DrawArrow(ssPos + Vector3.right / 2, serverLerpState.Impulse);
        if (drawMoves)
        {
            GizmoUtils.DrawText(serverLerpState.MoveNumber.ToString(), ssPos + Vector3.right / 4, 15);
        }

        //client predictedState
        Gizmos.color = color3;
        Vector3 clientPrediction = predictedState.WorldPosition;

        Gizmos.DrawWireCube(clientPrediction, size3);
        GizmoUtils.DrawArrow(clientPrediction + Vector3.left / 5, predictedState.Impulse);
        if (drawMoves)
        {
            GizmoUtils.DrawText(predictedState.MoveNumber.ToString(), clientPrediction + Vector3.left, 15);
        }

        //client ghostState
        Gizmos.color = color6;
        Vector3 ghostPrediction = ghostPredictedState.WorldPosition;

        Gizmos.DrawWireCube(ghostPrediction, size6);
        //			GizmoUtils.DrawArrow( ghostPrediction + Vector3.left / 5, predictedState.Impulse );
        if (drawMoves)
        {
            GizmoUtils.DrawText(ghostPredictedState.MoveNumber.ToString(), ghostPrediction + Vector3.up / 2, 15);
        }

        //client playerState
        Gizmos.color = color4;
        Vector3 clientState = playerState.WorldPosition;

        Gizmos.DrawWireCube(clientState, size4);
        GizmoUtils.DrawArrow(clientState + Vector3.right / 5, playerState.Impulse);
        if (drawMoves)
        {
            GizmoUtils.DrawText(playerState.MoveNumber.ToString(), clientState + Vector3.right, 15);
        }
    }
Beispiel #11
0
	void OnDrawGizmos ()
	{
		Gizmos.color = Color.green;
		GizmoUtils.DrawArrow(transform.position, - transform.up);
	}