コード例 #1
0
    void Awake()
    {
        networkView = GetComponent <NetworkView>();
        cam         = GameObject.Find("Camera");
        mngr        = cam.GetComponent <MouseInputManager>();
        if (server)
        {
            LaunchServer();
            mngr.enabled = false;
            StartCoroutine(checkPlayers());
        }
        else
        {
            ConnectServer();
        }
        if (Application.loadedLevelName == "MainMenu" || Application.loadedLevelName == "Options" || Application.loadedLevelName == "PlanetSelector" || Application.loadedLevelName == "ProfileSelector")
        {
            isMenu = true;
        }
        entities     = new Dictionary <Vector3Int, GameEntity> (new Vector3EqualityComparer());
        sensorSpaces = new Dictionary <Vector3Int, List <BasicSensor> > (new Vector3EqualityComparer());
        images[0]    = Resources.Load("Art/Textures/GUI/button_exit") as Texture2D;
        images[1]    = Resources.Load("Art/Textures/GUI/button_hint") as Texture2D;
        images[2]    = Resources.Load("Art/Textures/GUI/button_restart") as Texture2D;
        skin         = Resources.Load("Art/Textures/GUI/ingame_skin") as GUISkin;
        foreach (GameObject go in FindObjectsOfType(typeof(GameObject)))
        {
            if (go.name == "Camera")
            {
                CameraDecubeLevel c = go.GetComponent <CameraDecubeLevel>();
                levelCamera = c;
                break;
            }
        }
        hints = new List <string>();
        path  = "Assets/Resources/Txt/hints.txt";
        try{
            tr = new StreamReader(path);
            string temp;
            while ((temp = tr.ReadLine()) != null)
            {
                if (hints.Count == 12)
                {
                    hints.Add(temp);
                }
                hints.Add(temp);
            }

            // Close the stream
            tr.Close();
        }
        catch (FileLoadException e) {
            Debug.LogException(e);
        }
    }
コード例 #2
0
 void Start()
 {
     gameCamera = gameObject.GetComponent <CameraDecubeLevel> ();
 }
コード例 #3
0
ファイル: Level.cs プロジェクト: semvidEAFIT/project-decubed
    void Awake()
    {
        if (Application.loadedLevelName == "MainMenu" || Application.loadedLevelName == "Options" || Application.loadedLevelName == "PlanetSelector" || Application.loadedLevelName == "ProfileSelector")
        {
            isMenu = true;
        }
        entities = new Dictionary<Vector3Int, GameEntity> (new Vector3EqualityComparer ());
        sensorSpaces = new Dictionary<Vector3Int, List<BasicSensor>> (new Vector3EqualityComparer ());
        images[0] = Resources.Load("Art/Textures/GUI/button_exit") as Texture2D;
        images[1] = Resources.Load("Art/Textures/GUI/button_hint") as Texture2D;
        images[2] = Resources.Load("Art/Textures/GUI/button_restart") as Texture2D;
        skin = 		Resources.Load("Art/Textures/GUI/ingame_skin") as GUISkin;
        foreach (GameObject go in FindObjectsOfType(typeof(GameObject))){
            if (go.name == "Camera"){
                CameraDecubeLevel c = go.GetComponent<CameraDecubeLevel>();
                levelCamera = c;
                break;
            }
        }
        hints = new List<string>();
        path = "Assets/Resources/Txt/hints.txt";
        try{
            tr = new StreamReader(path);
            string temp;
            while((temp = tr.ReadLine()) != null)
            {
                if(hints.Count == 12){
                    hints.Add(temp);
                }
                hints.Add(temp);
            }

            // Close the stream
            tr.Close();
        }
        catch(FileLoadException e) {
            Debug.LogException(e);
        }
    }
コード例 #4
0
 void Start()
 {
     gameCamera = gameObject.GetComponent<CameraDecubeLevel> ();
 }