public static void InterpretInformation()
        {
            var           path    = GetFilePath();
            string        data    = File.ReadAllText(path);
            SceneSettings Options = JsonConvert.DeserializeObject <SceneSettings>(data);

            ManiacINIData = Options;
        }
Exemple #2
0
        /// <summary>
        /// return the scene settings for whichever scene is currently open and active
        /// </summary>
        /// <returns></returns>
        public static SceneSettings FindCurrentScene()
        {
            SceneSettings returnSettings = null;

            returnSettings = FindSceneByPath(UnityEngine.SceneManagement.SceneManager.GetActiveScene().path);

            return(returnSettings);
        }
Exemple #3
0
 private void OnDestroy()
 {
     playerInput      = null;
     sceneSettings    = null;
     stateHandler     = null;
     runtimeInventory = null;
     player           = null;
 }
Exemple #4
0
 private static MapScriptGroup CreateMapScriptGroup(ScriptGroup scriptGroup, SceneSettings sceneSettings)
 {
     return(new MapScriptGroup(
                scriptGroup.Name,
                CreateMapScripts(scriptGroup.Scripts, sceneSettings),
                scriptGroup.IsActive,
                scriptGroup.IsSubroutine));
 }
Exemple #5
0
 public void Init(SceneSettings settings)
 {
     Nodes = new List<Node>();
     _wallsV = settings.VerticalWalls;
     _wallsH = settings.HorizontalWalls;
     Nodes.Clear();
     Add(new Node(0, 0));
 }
Exemple #6
0
 public void Init(SceneSettings settings)
 {
     Nodes   = new List <Node>();
     _wallsV = settings.VerticalWalls;
     _wallsH = settings.HorizontalWalls;
     Nodes.Clear();
     Add(new Node(0, 0));
 }
Exemple #7
0
 private void AddScripts(Entity scriptsEntity, ScriptList scriptList, SceneSettings sceneSettings)
 {
     scriptsEntity.AddComponent(new ScriptComponent
     {
         ScriptGroups = CreateMapScriptGroups(scriptList.ScriptGroups, sceneSettings),
         Scripts      = CreateMapScripts(scriptList.Scripts, sceneSettings)
     });
 }
    private void SceneConfiguration()
    {
        Scene sceneToCompare = (Scene)Enum.Parse(typeof(Scene),
                                                 SceneManager.GetActiveScene().name.ToUpper());

        var query = from settings in sceneSettings
                    where settings.scene == sceneToCompare
                    select settings;


        activeSceneSettings = query.ToList().First();

        {
            // checks if main scene is active and sets up intial player data(lives, scores)
            if (activeSceneSettings.scene == Scene.MAIN)
            {
                Lives = 5;
                Score = 0;
            }

            // applies scenesettings defined
            activeSoundClip        = activeSceneSettings.activeSoundClip;
            scoreLabel.enabled     = activeSceneSettings.scoreLabelEnabled;
            livesLabel.enabled     = activeSceneSettings.livesLabelEnabled;
            highScoreLabel.enabled = activeSceneSettings.highScoreLabelEnabled;
            startLabel.SetActive(activeSceneSettings.startButtonActive);
            endLabel.SetActive(activeSceneSettings.endLabelActive);
            startButton.SetActive(activeSceneSettings.startButtonActive);
            restartButton.SetActive(activeSceneSettings.restartButtonActive);

            // assigns text values to appropriate labels
            scoreLabel.text     = "Score: " + scoreBoard.score;
            livesLabel.text     = "Lives: " + scoreBoard.lives;
            highScoreLabel.text = "High Score: " + scoreBoard.highScore;
        }

        if ((activeSoundClip != SoundClip.NONE) && (activeSoundClip != SoundClip.NUM_OF_CLIPS))
        {
            AudioSource activeAudioSource = audioSources[(int)activeSoundClip];
            activeAudioSource.playOnAwake = true;
            activeAudioSource.loop        = true;
            activeAudioSource.volume      = 0.5f;
            activeAudioSource.Play();
        }



        // creates an empty container (list) of type GameObject
        clouds = new List <GameObject>();

        for (int cloudNum = 0; cloudNum < numberOfClouds; cloudNum++)
        {
            clouds.Add(Instantiate(cloud));
        }

        Instantiate(island);
    }
Exemple #9
0
        public MoveCameraToAction(ScriptAction action, SceneSettings sceneSettings)
        {
            _targetWaypoint = sceneSettings.Waypoints[action.Arguments[0].StringValue];

            _duration = TimeSpan.FromSeconds(action.Arguments[1].FloatValue.Value);

            // TODO: What is this?
            _shutter = action.Arguments[2].FloatValue.Value;
        }
Exemple #10
0
    private void SceneConfiguration()
    {
        // converts the scene name to an enum
        var sceneToCompare = (Scene)System.Enum.Parse(typeof(Scene),
                                                      SceneManager.GetActiveScene().name.ToUpper());

        // uses LINQ to return a setting that matches the current scene name
        var query = from setting in sceneSettings
                    where setting.scene == sceneToCompare
                    select setting;

        // returns the first item that matches the criteria from the list
        activeSceneSettings = query.ToList().First();

        {
            if (activeSceneSettings.scene == Scene.MAIN)
            {
                Lives = 5;
                Score = 0;
            }

            activeSoundClip        = activeSceneSettings.activeSoundClip;
            scoreLabel.enabled     = activeSceneSettings.scoreLabelEnabled;
            livesLabel.enabled     = activeSceneSettings.livesLabelEnabled;
            highScoreLabel.enabled = activeSceneSettings.highScoreLabelEnabled;
            startLabel.SetActive(activeSceneSettings.startLabelSetActive);
            endLabel.SetActive(activeSceneSettings.endLabelSetActive);
            startButton.SetActive(activeSceneSettings.startButtonActive);
            restartButton.SetActive(activeSceneSettings.restartButtonActive);

            scoreLabel.text     = "Score: " + scoreBoard.score;
            livesLabel.text     = "Lives: " + scoreBoard.lives;
            highScoreLabel.text = "High Score: " + scoreBoard.highScore;
        }

        if ((activeSoundClip != SoundClip.NONE) && (activeSoundClip != SoundClip.NUM_OF_CLIPS))
        {
            AudioSource activeAudioSource = audioSources[(int)activeSoundClip];
            activeAudioSource.playOnAwake = true;
            activeAudioSource.loop        = true;
            activeAudioSource.volume      = 0.5f;
            activeAudioSource.Play();
        }



        // creates an empty container (list) of type GameObject
        clouds = new List <GameObject>();

        for (int cloudNum = 0; cloudNum < numberOfClouds; cloudNum++)
        {
            clouds.Add(Instantiate(cloud));
        }

        Instantiate(island);
    }
Exemple #11
0
    private void InitialiseObjects()
    {
        Undo.RegisterSceneUndo("Organise room objects");

        CreateFolder("_Cameras");
        CreateFolder("_Cutscenes");
        CreateFolder("_DialogueOptions");
        CreateFolder("_Interactions");
        CreateFolder("_Lights");
        CreateFolder("_Logic");
        CreateFolder("_Navigation");
        CreateFolder("_NPCs");
        CreateFolder("_Sounds");
        CreateFolder("_SetGeometry");

        // Create subfolders
        CreateSubFolder("_Cameras", "_GameCameras");

        CreateSubFolder("_Logic", "_ArrowPrompts");
        CreateSubFolder("_Logic", "_Conversations");
        CreateSubFolder("_Logic", "_Hotspots");
        CreateSubFolder("_Logic", "_Triggers");

        CreateSubFolder("_Navigation", "_CollisionCubes");
        CreateSubFolder("_Navigation", "_CollisionCylinders");
        CreateSubFolder("_Navigation", "_Markers");
        CreateSubFolder("_Navigation", "_NavMesh");
        CreateSubFolder("_Navigation", "_Paths");
        CreateSubFolder("_Navigation", "_PlayerStarts");

        // Delete default main camera
        if (GameObject.FindWithTag(Tags.mainCamera))
        {
            GameObject mainCam = GameObject.FindWithTag(Tags.mainCamera);
            if (mainCam.GetComponent <MainCamera>() == null)
            {
                DestroyImmediate(mainCam);
            }
        }

        // Create main camera
        AddPrefab("Automatic", "MainCamera", false, false, false);
        PutInFolder(GameObject.FindWithTag(Tags.mainCamera), "_Cameras");

        // Create Game engine
        AddPrefab("Automatic", "GameEngine", false, false, false);

        // Assign Player Start
        SceneSettings startSettings = GameObject.FindWithTag(Tags.gameEngine).GetComponent <SceneSettings>();

        if (startSettings && startSettings.defaultPlayerStart == null)
        {
            PlayerStart playerStart = AddPrefab("Navigation", "PlayerStart", false, false, true).GetComponent <PlayerStart>();
            startSettings.defaultPlayerStart = playerStart;
        }
    }
        public static MapScriptCondition Create(ScriptCondition condition, SceneSettings sceneSettings)
        {
            if (!Factories.TryGetValue(condition.ContentType, out var factory))
            {
                // TODO: Implement this condition type.
                return(new FalseCondition());
            }

            return(factory(condition, sceneSettings));
        }
        public static MapScriptAction Create(ScriptAction action, SceneSettings sceneSettings, List <MapScriptAction> previousActions)
        {
            if (!Factories.TryGetValue(action.ContentType, out var factory))
            {
                // TODO: Implement this action type.
                return(new NoOpAction());
            }

            return(factory(action, sceneSettings));
        }
Exemple #14
0
 private void OnDestroy()
 {
     firstPersonCamera = null;
     stateHandler      = null;
     player            = null;
     playerInput       = null;
     mainCamera        = null;
     settingsManager   = null;
     sceneSettings     = null;
 }
Exemple #15
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 ///                                             PRIVATE FUNCTIONS											     ///
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Called on start of the game object to init variables
 /// </summary>
 private void Awake()
 {
     // Register the singleton
     if (Instance != null)
     {
         Debug.LogError("Multiple instances of SceneSettings!");
         Destroy(gameObject);
     }
     Instance = this;
 }
        public MoveCameraAlongWaypointPathAction(ScriptAction action, SceneSettings sceneSettings)
        {
            var firstNode = sceneSettings.Waypoints[action.Arguments[0].StringValue];

            _waypointPath = sceneSettings.WaypointPaths[firstNode];

            _duration = TimeSpan.FromSeconds(action.Arguments[1].FloatValue.Value);

            // TODO: What is this?
            _shutter = action.Arguments[2].FloatValue.Value;
        }
        public MoveCameraAlongWaypointPathAction(ScriptAction action, SceneSettings sceneSettings)
        {
            _waypointPath = sceneSettings.WaypointPaths[action.Arguments[0].StringValue];

            _direction = _waypointPath.End.Position - _waypointPath.Start.Position;

            _duration = TimeSpan.FromSeconds(action.Arguments[1].FloatValue.Value);

            // TODO: What is this?
            _shutter = action.Arguments[2].FloatValue.Value;
        }
Exemple #18
0
        private static MapScript[] CreateMapScripts(Script[] scripts, SceneSettings sceneSettings)
        {
            var result = new MapScript[scripts.Length];

            for (var i = 0; i < scripts.Length; i++)
            {
                result[i] = CreateMapScript(scripts[i], sceneSettings);
            }

            return(result);
        }
		private void Awake ()
		{
			if (disableRenderer)
			{
				Hide ();
			}

			settingsManager = AdvGame.GetReferences ().settingsManager;
			sceneSettings = GameObject.FindWithTag (Tags.gameEngine).GetComponent <SceneSettings>();

			ResetHoles ();
		}
Exemple #20
0
        /// <inheritdoc />
        public override void Setup(ScriptableRenderContext context, ref RenderingData renderingData)
        {
            Camera          camera          = renderingData.cameraData.camera;
            SceneSettings   sceneSettings   = SceneSettings.CurrentSceneSettings;
            CharacterShadow characterShadow = null;

            if (sceneSettings != null)
            {
                characterShadow = sceneSettings.m_CharacterShadow;
            }

            ref CameraData          cameraData             = ref renderingData.cameraData;
Exemple #21
0
    override public float Run()
    {
        if (newNavMesh)
        {
            SceneSettings  sceneSettings = GameObject.FindWithTag(Tags.gameEngine).GetComponent <SceneSettings>();
            NavigationMesh oldNavMesh    = sceneSettings.navMesh;
            oldNavMesh.TurnOff();
            newNavMesh.TurnOn();
            sceneSettings.navMesh = newNavMesh;
        }

        return(0f);
    }
		private void Awake ()
		{
			if (AdvGame.GetReferences () && AdvGame.GetReferences ().settingsManager)
			{
				settingsManager = AdvGame.GetReferences ().settingsManager;
			}
			
			playerInput = this.GetComponent <PlayerInput>();
			playerInteraction = this.GetComponent <PlayerInteraction>();
			playerCursor = this.GetComponent <PlayerCursor>();
			sceneSettings = this.GetComponent <SceneSettings>();
			navigationManager = this.GetComponent <NavigationManager>();
		}
Exemple #23
0
        private static void LoadObjects(
            ContentManager contentManager,
            Entity objectsEntity,
            HeightMap heightMap,
            MapObject[] mapObjects,
            SceneSettings sceneSettings)
        {
            var waypoints = new List <Waypoint>();

            foreach (var mapObject in mapObjects)
            {
                switch (mapObject.RoadType)
                {
                case RoadType.None:
                    var position = mapObject.Position;

                    switch (mapObject.TypeName)
                    {
                    case "*Waypoints/Waypoint":
                        var waypointID   = (uint)mapObject.Properties["waypointID"].Value;
                        var waypointName = (string)mapObject.Properties["waypointName"].Value;
                        waypoints.Add(new Waypoint(waypointID, waypointName, position));
                        break;

                    default:
                        position.Z = heightMap.GetHeight(position.X, position.Y);

                        var objectEntity = contentManager.InstantiateObject(mapObject.TypeName);
                        if (objectEntity != null)
                        {
                            objectEntity.Transform.LocalPosition    = position;
                            objectEntity.Transform.LocalEulerAngles = new Vector3(0, 0, mapObject.Angle);

                            objectsEntity.AddChild(objectEntity);
                        }
                        else
                        {
                            // TODO
                        }
                        break;
                    }
                    break;

                default:
                    // TODO: Roads.
                    break;
                }
            }

            sceneSettings.Waypoints = new WaypointCollection(waypoints);
        }
    private void SceneConfiguration()
    {
        //IEnumerable query;


        //nameof(query.ToList()[0].scene)

        var query = from settings in sceneSettings
                    where settings.scene == (Scene)Enum.Parse(typeof(Scene),
                                                              SceneManager.GetActiveScene().name.ToUpper())
                    select settings;

        activeSceneSettings = query.ToList()[0];

        {
            activeSoundClip        = activeSceneSettings.activeSoundClip;
            scoreLabel.enabled     = activeSceneSettings.scoreLabelEnabled;
            livesLabel.enabled     = activeSceneSettings.livesLabelEnabled;
            highScoreLabel.enabled = activeSceneSettings.highScoreLabelEnabled;
            startLabel.SetActive(activeSceneSettings.startLabelActive);
            endLabel.SetActive(activeSceneSettings.endLabelActive);
            startButton.SetActive(activeSceneSettings.startButtonActive);
            restartButton.SetActive(activeSceneSettings.restartButtonActive);
            highScoreLabel.text = "High Score: " + scoreBoard.highScore;
        }

        Lives = 5;
        Score = 0;


        if ((activeSoundClip != SoundClip.NONE) && (activeSoundClip != SoundClip.NUM_OF_CLIPS))
        {
            AudioSource activeAudioSource = audioSources[(int)activeSoundClip];
            activeAudioSource.playOnAwake = true;
            activeAudioSource.loop        = true;
            activeAudioSource.volume      = 0.5f;
            activeAudioSource.Play();
        }



        // creates an empty container (list) of type GameObject
        clouds = new List <GameObject>();

        for (int cloudNum = 0; cloudNum < numberOfClouds; cloudNum++)
        {
            clouds.Add(Instantiate(cloud));
        }

        Instantiate(island);
    }
Exemple #25
0
    private void UnloadNavMesh(int navMeshInt)
    {
        NavigationMesh navMesh       = Serializer.returnComponent <NavigationMesh> (navMeshInt);
        SceneSettings  sceneSettings = GameObject.FindWithTag(Tags.gameEngine).GetComponent <SceneSettings>();

        if (navMesh && navMesh.collider && sceneSettings)
        {
            NavigationMesh oldNavMesh = sceneSettings.navMesh;
            oldNavMesh.TurnOff();
            navMesh.collider.GetComponent <NavigationMesh>().TurnOn();

            sceneSettings.navMesh = navMesh;
        }
    }
Exemple #26
0
        private static void LoadObjects(
            ContentManager contentManager,
            Entity objectsEntity,
            HeightMap heightMap,
            MapObject[] mapObjects,
            SceneSettings sceneSettings)
        {
            var waypoints = new List <Waypoint>();

            foreach (var mapObject in mapObjects)
            {
                switch (mapObject.RoadType)
                {
                case RoadType.None:
                    var position = mapObject.Position;

                    switch (mapObject.TypeName)
                    {
                    case "*Waypoints/Waypoint":
                        waypoints.Add(CreateWaypoint(mapObject));
                        break;

                    default:
                        // TODO: Handle locomotors when they're implemented.
                        position.Z += heightMap.GetHeight(position.X, position.Y);

                        var objectEntity = contentManager.InstantiateObject(mapObject.TypeName);
                        if (objectEntity != null)
                        {
                            objectEntity.Transform.LocalPosition    = position;
                            objectEntity.Transform.LocalEulerAngles = new Vector3(0, 0, mapObject.Angle);

                            objectsEntity.AddChild(objectEntity);
                        }
                        else
                        {
                            // TODO
                        }
                        break;
                    }
                    break;

                default:
                    // TODO: Roads.
                    break;
                }
            }

            sceneSettings.Waypoints = new WaypointCollection(waypoints);
        }
Exemple #27
0
    void Awake()
    {
        playerInput   = this.GetComponent <PlayerInput>();
        sceneSettings = this.GetComponent <SceneSettings>();

        if (AdvGame.GetReferences() == null)
        {
            Debug.LogError("A References file is required - please use the Adventure Creator window to create one.");
        }
        else
        {
            settingsManager = AdvGame.GetReferences().settingsManager;
        }
    }
Exemple #28
0
    private void UIConfiguration()
    {
        var query = from settings in sceneSettings
                    where settings.scene == (Scene)Enum.Parse(typeof(Scene), SceneManager.GetActiveScene().name.ToUpper())
                    select settings;

        activeSceneSettings = query.ToList().First();
        Debug.Log(activeSceneSettings);


        buttonPanel.SetActive(activeSceneSettings.buttonPanelEnabled);
        mainLabel.SetActive(activeSceneSettings.startLabelActive);
        startButton.SetActive(activeSceneSettings.startButtonActive);
        //restartButton.SetActive(activeSceneSettings.restartButtonActive);
        quitButton.SetActive(activeSceneSettings.quitButtonActive);
    }
Exemple #29
0
    private void Awake()
    {
        if (AdvGame.GetReferences() && AdvGame.GetReferences().settingsManager)
        {
            settingsManager = AdvGame.GetReferences().settingsManager;
        }

        playerInput       = this.GetComponent <PlayerInput>();
        playerInteraction = this.GetComponent <PlayerInteraction>();
        sceneSettings     = this.GetComponent <SceneSettings>();

        if (GameObject.FindWithTag(Tags.mainCamera) && GameObject.FindWithTag(Tags.mainCamera).GetComponent <MainCamera>())
        {
            mainCamera = GameObject.FindWithTag(Tags.mainCamera).GetComponent <MainCamera>();
        }
    }
Exemple #30
0
    private void SpendGem()
    {
        var gem = TimeHandler.GemTimeValue(_time - DateTime.Now);

        if (_characterManager.UserPlayer.Gem > gem)
        {
            _characterManager.AddCharacterSetting("Gem", -gem);
        }
        else
        {
            _messagePanelHandler.ShowMessage("You don't have enough Gem ! ", MessagePanel.PanelType.Ok);
            SceneSettings.GoToShopScene("Gem");
            return;
        }
        _characterManager.SetCharacterResearchingTime();
        _time = DateTime.Now;
    }
Exemple #31
0
        private static MapScript CreateMapScript(Script script, SceneSettings sceneSettings)
        {
            var conditions = CreateMapScriptConditions(script.OrConditions, sceneSettings);

            var actionsIfTrue  = CreateMapScriptActions(script.ActionsIfTrue, sceneSettings);
            var actionsIfFalse = CreateMapScriptActions(script.ActionsIfFalse, sceneSettings);

            return(new MapScript(
                       script.Name,
                       conditions,
                       actionsIfTrue,
                       actionsIfFalse,
                       script.IsActive,
                       script.DeactivateUponSuccess,
                       script.IsSubroutine,
                       script.EvaluationInterval));
        }
Exemple #32
0
        public object Load(IResource resource)
        {
            var definition = (SceneSettingsDefinition)serializer.Deserialize(resource);

            var sceneSettings = new SceneSettings
            {
                MidnightSunDirection  = definition.MidnightSunDirection,
                MidnightMoonDirection = definition.MidnightMoonDirection,
                ShadowColor           = definition.ShadowColor,
                InitialFogEnabled     = definition.InitialFogEnabled,
                InitialFogStartScale  = definition.InitialFogStartRate,
                InitialFogEndScale    = definition.InitialFogEndRate,
                SecondsPerDay         = definition.SecondsPerDay,
                TimeStopped           = definition.TimeStopped,
                FixedSecondsPerDay    = definition.FixedSecondsPerDay
            };

            sceneSettings.Sunlight.DiffuseColor   = definition.SunlightDiffuseColor;
            sceneSettings.Sunlight.SpecularColor  = definition.SunlightSpecularColor;
            sceneSettings.Sunlight.Enabled        = definition.SunlightEnabled;
            sceneSettings.Moonlight.DiffuseColor  = definition.MoonlightDiffuseColor;
            sceneSettings.Moonlight.SpecularColor = definition.MoonlightSpecularColor;
            sceneSettings.Moonlight.Enabled       = definition.MoonlightEnabled;

            if (!ArrayHelper.IsNullOrEmpty(definition.SkyColors))
            {
                for (int i = 0; i < definition.SkyColors.Length; i++)
                {
                    var timeColor = ToTimeColor(ref definition.SkyColors[i]);
                    sceneSettings.SkyColors.AddColor(timeColor);
                }
            }

            if (!ArrayHelper.IsNullOrEmpty(definition.AmbientLightColors))
            {
                for (int i = 0; i < definition.AmbientLightColors.Length; i++)
                {
                    var timeColor = ToTimeColor(ref definition.AmbientLightColors[i]);
                    sceneSettings.AmbientLightColors.AddColor(timeColor);
                }
            }

            sceneSettings.Initialize();

            return(sceneSettings);
        }
Exemple #33
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (TargetResearch == null)
     {
         return;
     }
     if (_time < DateTime.Now)
     {
         SceneSettings.GoToResearchScene();
     }
     else
     {
         _messagePanelHandler.ShowMessage("Are you sure you want to buy out your wait time for " + TimeHandler.GemTimeValue(_time - DateTime.Now) + " gem(s)?",
                                          MessagePanel.PanelType.YesNo,
                                          SpendGem,
                                          SceneSettings.GoToResearchScene);
     }
 }
	private void Awake ()
	{
		Hide ();

		if (GameObject.FindWithTag (Tags.gameEngine) && GameObject.FindWithTag (Tags.gameEngine).GetComponent <SceneSettings>())
		{
			sceneSettings = GameObject.FindWithTag (Tags.gameEngine).GetComponent <SceneSettings>();
			if (sceneSettings.navigationMethod == AC_NavigationMethod.UnityNavigation)
			{
				if (LayerMask.NameToLayer (AdvGame.GetReferences ().settingsManager.navMeshLayer) == -1)
				{
					Debug.LogWarning ("No 'NavMesh' layer exists - please define one in the Tags Manager.");
				}
				else
				{
					gameObject.layer = LayerMask.NameToLayer (AdvGame.GetReferences ().settingsManager.navMeshLayer);
				}
			}
		}
	}
		public void TurnOn ()
		{
			if (sceneSettings == null)
			{
				sceneSettings = GameObject.FindWithTag (Tags.gameEngine).GetComponent <SceneSettings>();
			}
			if (settingsManager == null)
			{
				settingsManager = AdvGame.GetReferences ().settingsManager;
			}

			if (sceneSettings && (sceneSettings.navigationMethod == AC_NavigationMethod.meshCollider || sceneSettings.navigationMethod == AC_NavigationMethod.PolygonCollider))
			{
				if (LayerMask.NameToLayer (settingsManager.navMeshLayer) == -1)
				{
					Debug.LogWarning ("Can't find layer " + settingsManager.navMeshLayer + " - please define it in the Tags Manager and list it in the Settings Manager.");
				}
				else if (settingsManager.navMeshLayer != "")
				{
					gameObject.layer = LayerMask.NameToLayer (settingsManager.navMeshLayer);
				}
				
				if (sceneSettings.navigationMethod == AC_NavigationMethod.meshCollider && GetComponent <Collider>() == null)
				{
					Debug.LogWarning ("A Collider component must be attached to " + this.name + " for pathfinding to work - please attach one.");
				}
				else if (sceneSettings.navigationMethod == AC_NavigationMethod.PolygonCollider && GetComponent <Collider2D>() == null)
				{
					Debug.LogWarning ("A 2D Collider component must be attached to " + this.name + " for pathfinding to work - please attach one.");
				}
			}
			else if (sceneSettings)
			{
				Debug.LogWarning ("Cannot enable NavMesh " + this.name + " as this scene's Navigation Method is Unity Navigation.");
			}
			else
			{
				Debug.LogWarning ("Cannot enable NavMesh - no SceneSettings found.");
			}
		}
	private void OnDestroy ()
	{
		settingsManager = null;
		sceneSettings = null;
	}
		private void GetReferences ()
		{
			settingsManager = AdvGame.GetReferences ().settingsManager;
			if (settingsManager.IsInLoadingScene ())
			{
				return;
			}
			
			speechManager = AdvGame.GetReferences ().speechManager;
			cursorManager = AdvGame.GetReferences ().cursorManager;
			menuManager = AdvGame.GetReferences ().menuManager;
			
			playerCursor = GameObject.FindWithTag (Tags.gameEngine).GetComponent <PlayerCursor>();
			actionListManager = playerCursor.GetComponent <ActionListManager>();
			playerInput = playerCursor.GetComponent <PlayerInput>();
			playerInteraction = playerCursor.GetComponent <PlayerInteraction>();
			menuSystem = playerCursor.GetComponent <MenuSystem>();
			dialog = playerCursor.GetComponent <Dialog>();
			sceneSettings = playerCursor.GetComponent <SceneSettings>();
			
			stateHandler = this.GetComponent <StateHandler>();
			options = this.GetComponent <Options>();
			runtimeInventory = this.GetComponent <RuntimeInventory>();
		}
		private void OnDestroy ()
		{
			actionListManager = null;
			dialog = null;
			playerInput = null;
			playerInteraction = null;
			menuSystem = null;
			stateHandler = null;
			options = null;
			menus = null;
			runtimeInventory = null;
			settingsManager = null;
			cursorManager = null;
			speechManager = null;
			menuManager = null;
			sceneSettings = null;
		}
		private void OnDestroy ()
		{
			firstPersonCamera = null;
			playerInput = null;
			settingsManager = null;
			sceneSettings = null;
			playerMenus = null;
			navigationManager = null;
		}
Exemple #40
0
        /**
         * <summary>Unsets the values of all script variables, so that they can be re-assigned to the correct scene if multiple scenes are open.</summary>
         */
        public void ClearVariables()
        {
            playerPrefab = null;
            mainCameraPrefab = null;
            persistentEnginePrefab = null;
            gameEnginePrefab = null;

            // Managers
            sceneManagerPrefab = null;
            settingsManagerPrefab = null;
            actionsManagerPrefab = null;
            variablesManagerPrefab = null;
            inventoryManagerPrefab = null;
            speechManagerPrefab = null;
            cursorManagerPrefab = null;
            menuManagerPrefab = null;

            // PersistentEngine components
            optionsComponent = null;
            runtimeInventoryComponent = null;
            runtimeVariablesComponent = null;
            playerMenusComponent = null;
            stateHandlerComponent = null;
            sceneChangerComponent = null;
            saveSystemComponent = null;
            levelStorageComponent = null;
            runtimeLanguagesComponent = null;

            // GameEngine components
            menuSystemComponent = null;
            dialogComponent = null;
            playerInputComponent = null;
            playerInteractionComponent = null;
            playerMovementComponent = null;
            playerCursorComponent = null;
            playerQTEComponent = null;
            sceneSettingsComponent = null;
            navigationManagerComponent = null;
            actionListManagerComponent = null;
            localVariablesComponent = null;
            menuPreviewComponent = null;

            SetGameEngine ();
        }
	private void GetReferences ()
	{
		sceneSettings = GameObject.FindWithTag (Tags.gameEngine).GetComponent <SceneSettings>();
	}
	private void OnDestroy ()
	{
		sceneSettings = null;
	}