void Update() { sceneManager = (StorySceneManager)FindObjectOfType(typeof(StorySceneManager)); if (sceneManager.level >= 2 && beginningMusicSource.isPlaying) { beginningMusicSource.Stop(); villageMusicSource.Play(); } if (sceneManager.level >= 4 && villageMusicSource.isPlaying) { villageMusicSource.Stop(); rootsMusicSource.Play(); } /*if (sceneManager.level >= 6 && rootsMusicSource.isPlaying) { rootsMusicSource.Stop(); villageMusicSource.Play(); }*/ if (sceneManager.level >= 7 && rootsMusicSource.isPlaying) { rootsMusicSource.Stop(); endMusicSource.Play(); } }
void Start() { sceneManager = (StorySceneManager)FindObjectOfType(typeof(StorySceneManager)); currentScene = sceneManager.level; float x = sceneManager.scene[currentScene].playerX; float y = sceneManager.scene[currentScene].playerY; transform.position = new Vector3(x, y); target = transform.position; rb = GetComponent<Rigidbody2D>(); }
// Use this for initialization protected virtual void Start() { transform.position = new Vector3(x, y); minSize = transform.localScale; sceneManager = (StorySceneManager)FindObjectOfType(typeof(StorySceneManager)); gameManager = (StoryGameManager)FindObjectOfType(typeof(StoryGameManager)); animator = gameObject.GetComponent<Animator>(); boxCollider = gameObject.GetComponent<BoxCollider2D>(); minColliderSize = boxCollider.size; PNJLoadEvent(); }
void Awake() { if (instance != null) { Debug.LogError("Multiple instances of StorySceneManager!"); } instance = this; // Instantiate Lights spotLights = new List<Light> (); Light[] lights = Object.FindObjectsOfType<Light>(); foreach (Light light in lights) { if (light.type == LightType.Spot) { spotLights.Add (light); } else if (light.type == LightType.Directional) { dirLight = light; } } }
// Use this for initialization void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); DontDestroyOnLoad(gameObject); scene = GetComponent<StorySceneManager>(); PNJTable = new List<string>(); ObjectsTable = new List<string>(); PNJTable.Add("Pixie"); PNJTable.Add("Gaby"); PNJTable.Add("Philibert"); InitGame(); }
// Use this for initialization protected virtual void Start() { questionnaire = GameObject.Find("Navigator").GetComponent<Questionnaire>(); numberOfQuestions = StoryGameManager.instance.numberOfQuestions; transform.position = new Vector3(x, y); minSize = transform.localScale; /*if (hasDialog) { dialogManager = GetComponent<DialogManager>(); }*/ sceneManager = (StorySceneManager)FindObjectOfType(typeof(StorySceneManager)); gameManager = (StoryGameManager)FindObjectOfType(typeof(StoryGameManager)); animator = gameObject.GetComponent<Animator>(); boxCollider = gameObject.GetComponent<BoxCollider2D>(); minColliderSize = boxCollider.size; PNJLoadEvent(); }
void OnTriggerEnter2D(Collider2D player) { sceneManager = (StorySceneManager)FindObjectOfType(typeof(StorySceneManager)); sceneManager.level++; ; }
// Use this for initialization void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); DontDestroyOnLoad(gameObject); scene = GetComponent<StorySceneManager>(); player = (StoryPlayer)FindObjectOfType(typeof(StoryPlayer)); InitCharacterDic(); fader = GameObject.Find("Navigator").GetComponent<Fading>(); PNJTable = new List<string>(); ObjectsTable = new List<string>(); PNJTable.Add("Pixie"); PNJTable.Add("Gaby"); //PNJTable.Add("Philibert"); //PNJTable.Add("Camille"); //PNJTable.Add("Victor"); //PNJTable.Add("Olivier-happy"); //ObjectsTable.Add("Lunettes"); //ObjectsTable.Add("Seve"); //ObjectsTable.Add("Secret"); InitGame(); }
private void Awake() { sceneManager = StorySceneManager.Instance; rectTransform = GetComponent <RectTransform>(); }