CMD Activate Windows 10 (Updated)!!
C:\Windows\system32>
" as it will already be there.C:\Windows\system32>
" as it will already be there.
Getting Unity VScode to work on Unity particularly 2018, but may work on other versions too.
Visual Studio Code.
Getting VScode to successfully integrate with the Unity Game Engine was a real pain in the eye, as I sought, for weeks, downloading and installing all sorts of arsenals, yet dealing no damage to my frustration.
Though I already had Visual Studio Community 19, I wanted the speed and lightness in Visual Studio Code, so I downloaded all available Net FrameWorks, installed mono, or so did I. And whatever, yet nothing.
However, the solution was very simple, just not common. XD
The log on the Omnisharp Error Indicated that the Unity project required Net Target FrameWork v4.5. However, this version at the moment is not even available for download.
The solution is therefore to disguise another Target FrameWork as v4.5.
Others seem to get it done by duplicating, say v4.7.2, and renaming it to v4.5, but that didn't work for me.
So I found this method, using CMD to create a directory that emulates the target folder.
Here's the process:
# Goto the net directory (mine is "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework") to copy the path
#Open comand prompt (CMD) as admin
# Enter "cd" and then directory you copied
#press "Enter"
#Type "mklink /J v4.5 v4.7.2"...this creates a virtual directory with the name v4.5, but with contents of v4.7.2 (if you've not installed .Net 4.7.2, you can enter the one you have).
#Done!!
Open a project in Unity. Create a script and open it.
Make sure the Unity's external editor is to VScode (it's not compulsory, but ease of use).
When VScode opens, wait till Omnisharp starts and run below (lower left).
When it's fully loaded, you'd see the name of your project at the bottom left.
Happy coding!!!
Here's a mini project to create a calculator that runs on console.
7 months(about 4 months active) into self-taught programming. 98% complete. Only bug is, its exiting may take about four confirmations before going through.
At the start of the program, addition is already active. Therefore, after every entry, the new input is added the old result, until a different operator is entered.
a = Adds = Subtract
d = Divide
m = Multiply
c = Clear
x = Exit
Its works for lower characters also.
*------------------------------------------------------------------------------------------------------------*
using System;
using System.Text;
public class ConsoleCalc0
{
public static void Main(string[] args)
{
string histDisp = default;
//string mainDisp = "0";
string input;
string[] ops = {"add", "minus", "multi", "div"};
string[] funcs = {"a","s","m","d","x"};
bool isNum;
//bool isOp;
bool closing = false;
bool refresh = true;
double newNum = 0;
double oldNum = 0;
double result = 0;
string operand = ops[0];
/*......................................................*/
Console.WriteLine("---Welcome to MiConsoleCalc---");
_App();
//////////////////////////////////////////////////
void _App()
{
Disp();
OnInput();
if (!closing)
{
_App();
}
else Exits();
}
void Disp()
{
Console.WriteLine("---------------------------------------");
Console.WriteLine(histDisp);
Console.WriteLine(operand+"........="+result+"\n"+oldNum);
}
void OnInput()
{
input = Console.ReadLine();
isNum = double.TryParse(input, out newNum);
if (isNum)
{
oldNum = newNum;
NumOp();
}
if (!isNum)
{
newNum = oldNum;
Functs();
}
if (histDisp==default)
{
refresh = true;
}
else refresh = false;
}
void Functs()
{
switch (input)
{
case "a":
operand = ops[0];
_App();
break;
case "s":
operand = ops[1];
_App();
break;
case "m":
operand = ops[2];
_App();
break;
case "d":
operand = ops[3];
_App();
break;
case "x":
closing = true;
break;
case "c":
newNum=0;
oldNum=0;
histDisp=default;
result = 0;
Console.WriteLine("..........reset..........");
break;
default: break;
}
}
void NumOp()
{
if(!refresh){
switch (operand)
{
case "add":
histDisp += " + " + oldNum.ToString();
result += newNum;
break;
case "minus":
histDisp += " - " + oldNum.ToString();
result -= newNum;
break;
case "multi":
histDisp += " * " + oldNum.ToString();
result *= newNum;
break;
case "div":
histDisp += " / " + oldNum.ToString();
result /= newNum;
break;
default: break;
}
}
if (refresh)
{
switch (operand)
{
case "add":
histDisp +=oldNum.ToString();
result = newNum;
break;
case "minus":
histDisp +=oldNum.ToString();
result = newNum;
break;
case "multi":
histDisp +=oldNum.ToString();
result = newNum;
break;
case "div":
histDisp +=oldNum.ToString();
result = newNum;
break;
default: break;
}
}
}
void Exits()
{
Console.WriteLine("...press any key to exit");
Console.ReadKey();
}
}
}
*--------------------------------------------------------------------------------------------*
Feel free to copy and experiment on. As an IT enthusiast, the best investment you can give yourself, is to learn to COde.
Download it Here
