Why the UI text value is changing take affect only when returning back to the visual studio window and than back to the editor?

My guess is because I’m using OnValidate but is there another way to try to accomplish what I’m trying ?

The goal is use the drawn circle in one script information and use this information in another script.

For example the GameObject the draw circle script is attached to I want to get the Y position of that GameObject and assign the value to the other script specific variable in both Editor and Runtime modes.

This script draw a circle in this case around my player and I attached this script to a empty GameObject child of my player so I can change the circle height by changing the GameObject Y position :

using UnityEngine; using System.Collections; using System;  [ExecuteAlways] [RequireComponent(typeof(LineRenderer))] public class DrawRadiusAroundObject : MonoBehaviour {     [Range(1, 50)] public int segments = 50;     [Range(1, 5)] public float xRadius = 5;     [Range(1, 5)] public float yRadius = 5;     [Range(0.1f, 5f)] public float width = 0.1f;     public bool controlBothXradiusYradius = false;     public bool draw = true;      [SerializeField] private LineRenderer line;      private void Start()     {         if (!line) line = GetComponent<LineRenderer>();          CreatePoints();     }      //private void Update()     //{     //         //}      public void CreatePoints()     {         line.enabled = true;         line.widthMultiplier = width;         line.useWorldSpace = false;         line.widthMultiplier = width;         line.positionCount = segments + 1;          float x;         float y;          var angle = 20f;         var points = new Vector3[segments + 1];         for (int i = 0; i < segments + 1; i++)         {             x = Mathf.Sin(Mathf.Deg2Rad * angle) * xRadius;             y = Mathf.Cos(Mathf.Deg2Rad * angle) * yRadius;              points[i] = new Vector3(x, 0f, y);              angle += (380f / segments);         }          // it's way more efficient to do this in one go!         line.SetPositions(points);     }  #if UNITY_EDITOR     private float prevXRadius, prevYRadius;     private int prevSegments;     private float prevWidth;      private void OnValidate()     {         // Can't set up our line if the user hasn't connected it yet.         if (!line) line = GetComponent<LineRenderer>();         if (!line) return;          if (!draw)         {             // instead simply disable the component             line.enabled = false;         }         else         {             // Otherwise re-enable the component             // This will simply re-use the previously created points             line.enabled = true;              if (xRadius != prevXRadius || yRadius != prevYRadius || segments != prevSegments || width != prevWidth)             {                 CreatePoints();                  // Cache our most recently used values.                 prevXRadius = xRadius;                 prevYRadius = yRadius;                 prevSegments = segments;                 prevWidth = width;             }              if (controlBothXradiusYradius)             {                 yRadius = xRadius;             }         }     } #endif } 

The object with the drawn circle :

Drawn circle around the player

And this script is making an object the Target child to rotate around my player. I want by using the drawn circle information to set the rotating variables.

using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine;  [ExecuteAlways] public class SimpleRotate : MonoBehaviour {     public List<TextMeshProUGUI> uiText = new List<TextMeshProUGUI>();      public DrawRadiusAroundObject drawAround;      // Add this script to Cube(2)     [Header("Add your turret")]     public GameObject Turret;//to get the position in worldspace to which this gameObject will rotate around.      [Header("The axis by which it will rotate around")]     public Vector3 axis;//by which axis it will rotate. x,y or z.      [Header("Angle covered per update")]     public float angle; //or the speed of rotation.      public float upperLimit, lowerLimit, delay;// upperLimit & lowerLimit: heighest & lowest height;      private float height, prevHeight, time;//height:height it is trying to reach(randomly generated); prevHeight:stores last value of height;delay in radomness;       // Update is called once per frame     void Update()     {         //Gets the position of your 'Turret' and rotates this gameObject around it by the 'axis' provided at speed 'angle' in degrees per update          transform.RotateAround(Turret.transform.position, axis.normalized, angle);         time += Time.deltaTime;         //Sets value of 'height' randomly within 'upperLimit' & 'lowerLimit' after delay          if (time > delay)         {             prevHeight = height;             height = Random.Range(lowerLimit, upperLimit);             time = 0;         }         //Mathf.Lerp changes height from 'prevHeight' to 'height' gradually (smooth transition)           transform.position = new Vector3(transform.position.x, Mathf.Lerp(prevHeight, height, time), transform.position.z);          uiText[0].text = angle.ToString();         uiText[1].text = upperLimit.ToString();         uiText[2].text = lowerLimit.ToString();         uiText[3].text = delay.ToString();          upperLimit = drawAround.transform.position.y;     } } 

The object with the script that make Target object child to rotate around my player

Target is the basketball.

The basketball rotating around my player.

For example I tried to set the object Y position value on the Upper Limit variable in the SimpleRotate script.

Everything is getting update find in editor mode and runtime mode except the ui text.

First of all I’m not sure using [ExecuteAlways] in both scripts is the right way and second because I’m using OnValidate in the script that draw the circle the affecting on the variable upper limit is taking affect only when I validate by changing windows in the editor mode.

How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor

I followed this tutorial which is adding a custom button into Visual Editor as it is supposed to. But this is not adding the button into the Text(HTML) Editor. Can you please let me know how I can add my own button into Text(HTML) Editor only (or at least both! and not Visual one)

function enqueue_plugin_scripts($  plugin_array) {     //enqueue TinyMCE plugin script with its ID.     $  plugin_array["green_button_plugin"] =  plugin_dir_url(__FILE__) . "index.js";     return $  plugin_array; }  add_filter("mce_external_plugins", "enqueue_plugin_scripts");  function register_buttons_editor($  buttons) {     //register buttons with their id.     array_push($  buttons, "green");     return $  buttons; }  add_filter("mce_buttons", "register_buttons_editor"); 

Visual Editor Background

I have a WordPress site in which the background colour is black and the text is white. The site is fine, but it’s a real pain trying to edit content in the visual editor as the background is white and it is the same colour as the text.

so, How do I change the background colour of the visual editor to black or any other colour so that the content can be automatically readable if the text colour is to be white, because my normal page shows the dark colour in the background, but when I am doing a post, it is coming to be very painful that I don’t need to change it every time …

see image: enter image description here

Possible visual problem on HP laptop screen

I own an HP Laptop. It’s system model is something like 15-bs2xx and its model number is 3TT16UA#ABA (I believe these are the things that typically need to be known, I’m not a computer wiz at all). I don’t know if my eyes are just being hypersensitive or not, but I feel like my screen has this weird "stippling" effect, little dots of a slightly different color appear across certain colors like a dark gray, orange, or yellow. When I watch videos, there’s always weird spaces of dotty pixels as well, especially around illumination in a dark room. Is this how the computer screen is supposed to look or is there something wrong with my graphics?

Visual Studio Code on Linux – Privacy risk?

I’m a fan of Visual Studio, and recently installed VSC on my Linux Mint. However recently I did a deep-dive on Richard Stallman’s site reading about just how evil and depraved all the big tech companies are, including Microsoft (not that I didn’t already know that these companies are evil, I just didn’t realise the extent of their depravity).

Now I’m feeling edgy about having VSC on my machine. I’m security and privacy conscious, and use TOR browser often. I read recently that on Windows 10 machines, opening certain files through TOR browser reveals your real IP to Microsoft. This being the case, I’m wary of having microsoft software installed on my machine.

I was wondering what the risks are if I keep VSC installed on my Linux Mint 19? How can I confirm that this program is "sandboxed"? I don’t want it spying on me. What sort of information is it known to transmit to Microsoft, and what other information could it potentially be collecting without my knowledge?

Forgive me if this is a stupid question. I’m not sure how to do an independent investigation which is why I want to come here and ask the experts. If no one knows a direct answer to my question, I will still upvote pointers as to how I could investigate it independently. (I haven’t confirmed this, but knowing microsoft, VSC is closed-source, which obviously makes the job much harder)

Debugging T-Sql code using Visual Studio 2019. Error message: frame not in module

DBAs,
Has anyone had success using Visual Studio 2019 for debugging T-SQL code, the way SSMS allows Step-into & Step-over?

When I hit debug (Alt-F5), gives me this error, after making some progress. Looks like once it hits the section of the code that calls another procedure, it gives this error.

Frame not in module.   The current stack frame was not found in a loaded module. Source cannot be shown for this location. 

Example:

1  ..    2  ..   3  SELECT 1 FROM sys.objects   4  SELECT dbo.SomeFunction(1)   5  UPDATE TABLE SET X = 1 ....   6   

It runs well, until line 3, once it hits line 4, where it is calling a different function, it throws the aboe error. In SSMS, that line just opens a new window with code for the function and show debugging progress for each F11 step-into — but not in Visual Studio 2019 (Version 16.7.1)

Thanks

Security of Visual Studio Marketplace?

As a consumer of Visual Studio Marketplace extensions, I frequently find myself wondering if this or that nice little add-on might be a security problem. For example, maybe it uploads my code somewhere. Is this a risk I simply have to take? Is this somehow checked? In the case of a popular add-on, would it be reasonable to assume that if it did do something like that, someone would have noticed?

Some autocompletion doesn’t work in Visual Studio Code with Unity

I am using Unity 2018 with Visual Studio Code version 1.43.2 on a Mac.


Things seemed to work fine between Unity and Visual Studio Code, but now I realize that something is wrong with Code. I have been following along with a tutorial and the autocompletion functionality of Code seemed fine until the function OnTriggerEnter, which was shown as autocompleting for the guy in the video (who was using the other Visual Studio), didn’t fill in. However, many other Unity things do automatically show up as options.

I looked at this Microsoft help page about VS Code and Unity, and I have everything it I seems I would possibly need to combine the two; I have .NET, Mono, Debugger for Unity, the C# extension, and got Unity Tools for good measure.

Generic C# things like return, void, int, etc. autocomplete, so the C# extension seems fine. Many Unity things, like Vector3, GameObject, Destroy, transform, etc. also autocomplete like they should.

What is wrong here? How can I fix this and get full autocomplete?