void OnSceneChanged(SceneParent parent) { GameObject ghostSpawner = GameObject.Find("GhostSpawnManager"); ghostSpawnManager = ghostSpawner ? ghostSpawner.GetComponent <SpawnManager>() : null; m_elementParent.gameObject.SetActive(ghostSpawnManager != null); }
void OnSceneChanged(SceneParent parent) { m_sceneParent = parent; if (m_sceneParent && m_sceneParent.BossNeutralSprite) { m_portraitImage.sprite = parent.BossNeutralSprite; m_portraitImage.enabled = true; } else { m_portraitImage.enabled = false; } GameObject ghostSpawnObject = GameObject.Find("GhostSpawnManager"); m_ghostSpawnManager = ghostSpawnObject ? ghostSpawnObject.GetComponent <SpawnManager>() : null; if (m_objectiveManager) { m_objectiveManager.OnObjectiveIncremented -= OnObjectiveIncremented; } m_objectiveManager = FindObjectOfType <ObjectiveManager>(); if (m_objectiveManager) { m_objectiveManager.OnObjectiveIncremented += OnObjectiveIncremented; } }
public WorldAgent SpawnEnemyAgent(Vector3 pos, Quaternion quaternion, Country country) { WorldAgent agent = Instantiate(enemyAgentPrefab, pos, quaternion); SceneParent.ParentGameObjectToMe(agent.transform); agent.Setup(country); worldAgents.Add(agent); return(agent); }
protected override void Awake() { base.Awake(); SceneParent sceneParent = GetComponentInParent <SceneParent>(); if (sceneParent) { GetComponent <SpriteRenderer>().sprite = sceneParent.ObjectiveSprite; } }
public DrawContext(DrawContext context, int surfaceType) { this.device = context.device; this.root = context.root; this.renderingInstance = context.renderingInstance; this.context = context.context; this.width = context.width; this.height = context.height; this.renderer = context.renderer; this.surfaceType = surfaceType; this.AAFilter = context.AAFilter; this.pathError = context.pathError; }
public void SetupLinkFuses() { //Trying something out with loading linkpoints foreach (var item in LinkPoints) { foreach (var mount in item.Mounts) { SceneItem sceneitem = SceneParent.GetTemplate(mount.Key); if (sceneitem != null) { sceneitem.Mount(this, item.Name, mount.Value); } } } }
private void InstantiatePlayers() { SceneParent sceneParent = FindObjectOfType <SceneParent>(); PlayerSpawn[] spawnPoints = sceneParent.GetComponentsInChildren <PlayerSpawn>(); PlayerSpawn beepSpawn = null; PlayerSpawn boopSpawn = null; foreach (PlayerSpawn spawn in spawnPoints) { if (spawn.Player == PlayerType.Beep) { beepSpawn = spawn; } else if (spawn.Player == PlayerType.Boop) { boopSpawn = spawn; } } if (!GameManager.Instance.Beep) { if (!beepSpawn) { Debug.LogError("No Beep spawn found."); Instantiate(sceneParent.BeepPrefab); } else { Instantiate(sceneParent.BeepPrefab, beepSpawn.transform.position, beepSpawn.transform.rotation); } } if (!GameManager.Instance.Boop) { if (!boopSpawn) { Debug.LogError("No Boop spawn found."); Instantiate(sceneParent.BoopPrefab); } else { Instantiate(sceneParent.BoopPrefab, boopSpawn.transform.position, boopSpawn.transform.rotation); } } }
public void NextScene() { if (m_currentScene >= 0) { m_allScenes[m_currentScene].SceneInstance.gameObject.SetActive(false); } m_currentScene++; if (m_currentScene < m_allScenes.Length) { SceneParent sceneParent = m_allScenes[m_currentScene].SceneInstance; sceneParent.gameObject.SetActive(true); PlayerSpawn.RespawnAll(); CameraControl.Instance.GoTo(sceneParent.transform.position); if (OnSceneChanged != null) { OnSceneChanged(sceneParent); } } }
public void NotifySceneLoaded(SceneParent parent) { int index = 0; for (int i = 0; i < m_allScenes.Length; i++) { if (m_allScenes[i].SceneName == parent.SceneName) { index = i; m_allScenes[i].SceneInstance = parent; parent.gameObject.SetActive(false); break; } } // hardcoded scene height parent.transform.position = new Vector3(0f, 18f * (index + 1f), 0f); if (index == m_currentScene) { parent.gameObject.SetActive(true); PlayerSpawn.RespawnAll(); } }
private void OnSceneChanged(SceneParent sceneParent) { GameObject spawnObj = GameObject.Find("GhostSpawnManager"); m_ghostSpawnManager = spawnObj ? spawnObj.GetComponent <SpawnManager>() : null; }
void OnSceneChanged(SceneParent newScene) { m_image.sprite = newScene.ObjectiveSprite; }
void OnSceneChanged(SceneParent newScene) { m_sceneParent = newScene; m_objectiveManager = m_sceneParent.GetComponentInChildren <ObjectiveManager>(); }