Unity 3D with Visual Studio 2015 IDE.

Most of the time I used Mono IDE for Unity 3D.
Today I show you how to use Unity 3D with Visual Studio 2015.
You need to know this solution it’s a little slow but can solve another issues for development.
Some settings we make from start to the end will come with restart of both IDE.
Let’s start with the first step:
First install Visual Studio 2015 from here.
You need to know about the the Visual Studio : it’s on Windows OS only.
Now download Visual Studio Tools for Unity from Unitytools Visual Studio and install this download.
If your instalation will come with Repair just repair it.
This repair option it’s show you when the Visual Studio it’s install with Unity 3D package.
Open your Unity software and make this settings from Unity Preferences ( first menu of Unity 3D software).
Unity_Visual_Studio_tutorial_001
Duble left click to run the Visual Studio Tools for Unity from folder where you put the download.
Unity_Visual_Studio_tutorial_002
Select all and then accept this settings.
Unity_Visual_Studio_tutorial_003
You have one new folder add Assets into your project. You need to make more settings because will not working yet.
Make one new C# script and named it. I used the name : test. Start to develop your script by open this script.
Unity_Visual_Studio_tutorial_004
When you start your development of this script the Visual Studio 2015 start also.
Unity_Visual_Studio_tutorial_005
Now use right click mouse button to add Existing Item… or use the short key.
Unity_Visual_Studio_tutorial_006
Add the DLL files from your Unity 3D project ( Assets -> UnityVS folders).
Unity_Visual_Studio_tutorial_007
Try to build your solution from Visual Studio. Also check the settings of thise two DLL from Unity 3D by left click and check your options. If you got errors then restart both IDE: Visual Studio 2015 and Unity 3D.
This will fix all your imports and settings files.

Programming with C# and Unity 3D game engine – part 002

Today I will show you how to install Unity 5 for free.
First will need to download it from official website – free download.
You need to follow this steps: Select Unity 5 Personal Edition.
unity5-firststeps
Fill with your email adress and password from Unity website account.
unity5-firststeps-001
Select your answers …
unity5-firststeps-002
Press the blue button Start Unity and will be ready to start your project.
unity5-firststeps-003

Unity 3D – C# script – countdown timer tutorial.

This tutorial will show us how to make one simple countdown timer.
First go to Asserts tab and click with right mouse button.
Create new C# script and open it with double clicks – left mouse button.
Drag and drop the script into your main camera.
U3D-001
Fill into Mono Developer with this script:

Press Play Button and you will see this.
U3D-002
The GameOver is empty and you can put there your own game over script.

Programming with C# and Unity 3D game engine – part 001 .

This tutorial will cover the first steps programming with C#.
The C# is an more complicated language like another programming language.
Now, C# it is an object-oriented programming language like C++ or Java.
If you know this programming language then will be easy to you to use C#.
First in C# the entry point of program is a static function called Main inside a class, not more than one.
If you want to compile one C# program then you can use the compiler:
cc yourprogram.cs
… or just use the Mono IDE.
C# has data types, operators, variables, constants, typecasts, branching like any programming language.
Also C# allow you to create your own data types. This mean the C# is an extensible language.
Let’s see more about this:

  • data types: bool,byte, sbyte, char, short, ushort, int, uint, float, long, ulong, double, decimal
  • operators: +,-,*,/,%,++,–,*=,/=,-=,%=,>>=,<<=, bitwise, logical, shifting operators …
  • variables: int my_var = 1;
  • constants: const float my_const = 5;
  • typecasts: C# need to know if is an explicit and implicit conversions.
  • branching: if, switch, while, for, do-while, …

After you open the Unity 3D IDE the next step is to create the C# script.
Right click with the mouse into Project tab, like in the next image and simply create the script.
unitycsharp_script
The default script is named NewBehaviourScript and come with this source code:

You can see the class NewBehaviourScript calls to the Unity Engine ( see: using UnityEngine).
Also two functions:
Start() – this is called when the scene first launches and Update() – This is called in every frame that the game runs.
Unity 3D will rewrite the class name in your C# script when you will rename your script in the Project panel.
You can create new scripts and also can be used to call different features of the game engine.
Foe example you can create one new script to move, rotate or scale one object from Unity 3D Engine.