Visual Studio Code (vscode), not to be confused with Visual Studio, is a lightweight IDE that can do C# syntax highlighting, provide api autocompletion, and do type checks. If you are going to write Sansar scripts, then it is highly recommended you start with a proper IDE and not simply notepad.
- Download/clone/fork this repository and use it as your Sansar projects workspace
- Install Visual Studio Code
- In vscode, go to extensions (squares icon) and find and install
C# for Visual Studio Code
by Microsoft - Install .NET Core
- Install .NET Framework 4.7.2 Developer Pack
- Edit
get-sansar-lib.bat
and make sure the directory path in robocopy commands point to your Sansar installation on your computer, if it does not then change it and save. - Double click
get-sansar-lib.bat
(outside vscode) in the downloaded workspace in step 1, this will copy Sansar assemblies (dlls) and Script Library code to your local directory and will allow autcompletion of api and easily includeLibraryBase.cs
in your projects. - Open vscode in the downloaded workspace, open the terminal (Ctrl + ~), and type
dotnet restore
- Close and reopen vscode. You can now create your first Sansar script.
- Double click
get-sansar-lib.bat
(outside vscode) - Open vscode in the downloaded workspace, open the terminal (Ctrl + ~), and type
dotnet restore
- Close and reopen vscode
- Create a folder in your workspace, and create your C# files in that. If you need to include scripts from other projects, just add a .json file with paths pointing to your files, which can be uploaded to Sansar for multi file scripts.