Search Unity

Is installing Visual Studio Tools still necessary with Unity 2019? (weird compile error)

Discussion in 'External Tools' started by gmak, May 8, 2019.

  1. gmak

    gmak

    Joined:
    May 21, 2018
    Posts:
    9
    I've got VS 2017 installed and it mostly seems to work with Unity, but I'm wondering, is it necessary to install Visual Studio Tools for Unity with 2019? I'm new to VS and come from Java. I have a very simple script, yet, it only seems to work partly; for instance, I'm trying to load a scene, and from the doc, SceneManager.LoadScene("Scene2"); seems like it should have worked, but it gives me a 'SceneManager does not exist in the current context' error... Yet, UnityEngine.SceneManagement.SceneManager. works.

    Am I missing something in VS? Import issue? I'd have expected VS's autocomplete to find SceneManager, yet it does not... Other reason? Thanks!

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PuzzleSceneLoader: MonoBehaviour {
    6.     void Start()    {
    7.         // SceneManager.LoadScene("Scene2");
    8.         UnityEngine.SceneManagement.SceneManager.LoadScene("Scene2");
    9.     }
    10. }
     
  2. alexmcgt

    alexmcgt

    Joined:
    Aug 16, 2018
    Posts:
    4
    It has nothing to do with VS.
    Just add
    Code (CSharp):
    1. using UnityEngine.SceneManagement;
     
    gmak likes this.
  3. gmak

    gmak

    Joined:
    May 21, 2018
    Posts:
    9
    Ha.. Ok I think I figured it out. I think you don't need to install Unity Tools for VS, as I think there's a special VS build which includes them, or I forgot about installing it previously... Anyway, yeah thanks my issue was purely VS imports, which work quite differently from Eclipse or even MonoDevelop from what I remember...

    I'm used to just typing the class name and having the import added 'automatically' (ctrl+space), VS simply does not work like that, but typing the name then hitting, "Ctrl + ." will invoke "Display options on smarttag menu.Very useful for showing using/Imports options." does basically the same and allows you to select the class & add the import automatically. Thanks!
     
  4. nitrofurano

    nitrofurano

    Joined:
    Jun 7, 2019
    Posts:
    64
    i'm using a simple text editor, pluma (based on gedit) - i never installed visual studio in my computers - i guess you can use whatever text editor or ide instead of vs