void Start() { levelMaster = GameObject.Find("LevelMaster").GetComponent <LevelMaster>(); textToUpdate.color = newColor; textToUpdate.font = newFont; textToUpdate.fontSize = newFontSize; }
void Start() { levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>(); textToUpdate.color = newColor; textToUpdate.font = newFont; textToUpdate.fontSize = newFontSize; }
void Update() { if (LevelMaster.input.Continue()) { LevelMaster.Restart(); gameObject.SetActive(false); } }
void Update() { if (Input.GetKeyDown(KeyCode.Space)) { LevelMaster.Restart(); gameObject.SetActive(false); } }
private void Update() { lm = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>(); if (pauseGame) { Time.timeScale = 0; } }
void Awake() { if (init != null) { Destroy(this.gameObject); return; } init = this; GameObject.DontDestroyOnLoad(this.gameObject); }
// Use this for initialization void Start() { lm = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>(); gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>(); if (lm.GetReset()) { transform.position = gm.lastCheckpointPos; } }
private void Start() { game = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>(); // Initialise the reference to the script object, which is a // component of the pause menu panel game object pauseMenu = pauseMenuPanel.GetComponent <PauseMenuManager>(); pauseMenu.Hide(); }
private void Singleton() { if (instance == null) //Check if instance already exists { instance = this; //if not, set instance to this } else if (instance != this) //If instance already exists and it's not this: { Debug.Log("not the instance " + name); Destroy(gameObject); //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. } }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(instance); } else { Destroy(gameObject); } }
async private void Awake() { await BeforeSceneLoad.loadFinishTask; //实例化LevelMaster LevelMaster levelMaster = Jyx2ResourceHelper.CreatePrefabInstance(ConStr.LevelMaster).GetComponent <LevelMaster>(); DontDestroyOnLoad(levelMaster); levelMaster.name = "LevelMaster"; levelMaster.transform.SetParent(transform, false); levelMaster.RuntimeDataSimulate = m_RuntimeDataSimulate; levelMaster.MobileSimulate = m_MobileSimulate; }
public void Start() { LevelMaster.AddBlueDot(); if (activators.Count > 0) { foreach (BlueDot activator in activators) { activator.activates.Add(this); } active = false; } GetComponent <Animation> ().enabled = active; }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); game = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>(); gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>(); chick = GameObject.FindGameObjectWithTag("Chick"); transform.position = nest1; player.transform.position = player1; chick.transform.position = chick1; }
public override void OnEnter() { foreach (GameObject obj in GameTurnManager.GetInstance().m_PlayerPawns) { PawnBehavior bhv = obj.GetComponent <PawnBehavior>(); PawnStatistics stats = obj.GetComponent <PawnStatistics>(); GameStateManager.GetInstance().GetCharacter(bhv.m_CharacterId).SaveFrom(stats); } GameSceneManager.GetInstance().Pop(true); LevelMaster.GetInstance().ComeBackFromBattle(); }
private void Start() { gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>(); player = GameObject.FindGameObjectWithTag("Player"); chick = GameObject.FindGameObjectWithTag("Chick"); //game.menuChick = GameObject.FindGameObjectWithTag("menuChick").GetComponent<Image>(); //game.menuWorm = GameObject.FindGameObjectWithTag("menuWorm").GetComponent<Image>(); //game.menuReset = GameObject.FindGameObjectWithTag("menureset").GetComponent<Image>(); boxes = GameObject.FindGameObjectsWithTag("Box"); logs = GameObject.FindGameObjectsWithTag("Log"); boxesStart = new Vector3[boxes.Length]; logsStart = new Vector3[logs.Length]; for (int i = 0; i < logs.Length; i++) { logsStart[i] = logs[i].transform.position; } for (int i = 0; i < boxes.Length; i++) { boxesStart[i] = boxes[i].transform.position; } game = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>(); game.menuChickStar = GameObject.FindGameObjectWithTag("menuChickStar"); game.menuWormStar = GameObject.FindGameObjectWithTag("menuWormStar"); game.menuResetStar = GameObject.FindGameObjectWithTag("menuResetStar"); game.levelComplete = false; game.collectibleFound = false; // Initialise the reference to the script object, which is a // component of the pause menu panel game object //levelComplete = levelCompletePanel.GetComponent<CompleteLevelManager>(); pauseMenu = pauseMenuPanel.GetComponent <PauseMenuManager>(); //pauseMenu.Hide(); }
// Use this for initialization void Awake() { smokeTrail.enableEmission = false; maxHealth = health; forwardSpeed = Random.Range(speedRange.x, speedRange.y); //transform.position = new Vector3(transform.position.x, Random.Range (heightRange.x, heightRange.y), transform.position.z); levelMaster = (LevelMaster)GameObject.FindGameObjectWithTag("LevelMaster").GetComponent("LevelMaster"); forwardSpeed *= levelMaster.difficultyMultiplier; health *= levelMaster.difficultyMultiplier; maxHealth *= levelMaster.difficultyMultiplier; Debug.Log("Parent Awake"); }
// Use this for initialization void Awake() { smokeTrail.enableEmission = false; maxHealth = health; forwardSpeed = Random.Range (speedRange.x, speedRange.y); //transform.position = new Vector3(transform.position.x, Random.Range (heightRange.x, heightRange.y), transform.position.z); levelMaster = (LevelMaster)GameObject.FindGameObjectWithTag ("LevelMaster").GetComponent ("LevelMaster"); forwardSpeed *= levelMaster.difficultyMultiplier; health *= levelMaster.difficultyMultiplier; maxHealth *= levelMaster.difficultyMultiplier; Debug.Log ("Parent Awake"); }
//Before Start() //When script initial void Awake() { //connect to levelmaster levelMaster = LevelMaster.Instance; //set health and speed maxHealth = health; forwardSpeed = Random.Range(speedRange.x, speedRange.y); //multiply the speed and health based on difficulty forwardSpeed *= levelMaster.difficultyMultiplier; health *= levelMaster.difficultyMultiplier; maxHealth *= levelMaster.difficultyMultiplier; }
public void OnTriggerEnter2D(Collider2D collider) { if (active) { AudioManager.instance.PlayDotPickup(); LevelMaster.CollectBlueDot(transform.position); foreach (BlueDot activated in activates) { // TODO(samkern): Delay this activation and play a sound. activated.Activate(this); } Destroy(this.gameObject); } }
void OnTriggerEnter(Collider _col) { PlayerBehavior behavior = _col.GetComponent <PlayerBehavior>(); if (behavior != null) { if (m_CanEnterInCombat) { m_CanEnterInCombat = false; m_Runner.SetCurrentState((int)EnemyState.DeathEffect, "collision with player"); LevelMaster.GetInstance().StartBattleTransition(m_CombatSettings); } } }
private void Die() { AudioManager.PlayPlayerDeath(); Time.timeScale = 1.0f; Time.fixedDeltaTime = 0.02F * Time.timeScale; LevelMaster.Defeat(); GameObject explosion = Instantiate(ParticleManager.playerExplosion); explosion.transform.position = transform.position; Camera.main.StartShake(.3f, .3f, 2f, true); //Camera.main.ZoomIn (10.0f, PlayerCamera.originalSize - 2.0f, transform.position); Destroy(this.gameObject); }
void OnTriggerEnter(Collider other) { if (levelMaster == null) { levelMaster = LevelMaster.Instance; } // Debug.Log("Trigger"); if (other.gameObject.tag == "Ground Enemy" || other.gameObject.tag == "Air Enemy") { // Debug.Log("Boom"); Destroy(other.gameObject); levelMaster.enemyCount--; levelMaster.livesCount--; levelMaster.UpdateGUI(); } }
public void N_Restart() { levelText.enabled = true; gameOverPanel.SetActive(false); victoryPanel.SetActive(false); if (victoryPanel.transform.Find("NameInput").gameObject.activeInHierarchy) { LevelMaster.SaveHighScoreName(0, scoreName); victoryPanel.transform.Find("NameInput").gameObject.SetActive(false); } timing = true; timerMin = 0.0f; timerSec = 0.0f; timerText.text = "0:00:00"; }
void Update() { if (LevelMaster.input.MenuExit()) { gameObject.SetActive(false); } else if (Input.GetKeyDown(KeyCode.Q)) { Application.Quit(); } else if (LevelMaster.input.Continue()) { LevelMaster.Restart(); Notifications.self.SendPauseNotification(false); gameObject.SetActive(false); } }
// Use this for initialization void Start() { //anim = noteType.NoteAnimation; //gameObject.GetComponent<Animator>().runtimeAnimatorController = anim; Renderer render = gameObject.GetComponent <Renderer>(); levelMaster = GameObject.Find("LevelMaster").GetComponent <LevelMaster>(); noteType = levelMaster.DetermineType(); endValue = noteType.endValue; hitValue = noteType.hitValue; material = noteType.material; bad = noteType.bad; scoreSystem = noteType.scoreSystem; render.material = material; render.material.color = noteType.colour; levelMaster.RegisterNode(this); }
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { gameObject.SetActive(false); } else if (Input.GetKeyDown(KeyCode.Q)) { Application.Quit(); } else if (Input.GetKeyDown(KeyCode.Space)) { LevelMaster.Restart(); Notifications.self.SendPauseNotification(false); gameObject.SetActive(false); } }
void OnTriggerExit(Collider other) { if (!enabled) { return; } if (exitLockDirection) { LevelMaster levelMaster = GameObject.FindObjectOfType <LevelMaster>(); //开启方向锁 levelMaster.m_IsLockingDirection = true; } if (m_UnlockTarget) { if (old_followTarget != null) { vcam.Follow = old_followTarget; } } }
// Use this for initialization void Start() { levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>(); levelMasterObj = GameObject.Find("LevelMaster"); }
// Use this for initialization void Start() { //anim = noteType.NoteAnimation; //gameObject.GetComponent<Animator>().runtimeAnimatorController = anim; Renderer render = gameObject.GetComponent<Renderer>(); levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>(); noteType = levelMaster.DetermineType(); endValue = noteType.endValue; hitValue = noteType.hitValue; material = noteType.material; bad = noteType.bad; scoreSystem = noteType.scoreSystem; render.material = material; render.material.color = noteType.colour; levelMaster.RegisterNode(this); }
public static void GameTown() { for (int i = 0; i < Time.Events.Count; i++) { if (Time.Events[i].name == "Bank Construction" && Time.Events[i].trigger && Time.Events[i].active) { bank = true; } } Console.Clear(); Utilities.ColourText(Colour.SPEAK, "You are in the town of Marburgh. It is a small town, but is clearly growing. Who knows what will be here in a month?\n\n"); if (tutorial) { Console.WriteLine("[W]eapon shop [A]rmor shop [I]tem shop [D]ungeon"); } else { Console.WriteLine("[I]tem shop [D]ungeon"); } if (tutorial && bank) { Console.WriteLine("[T]avern [Y]our house [B]ank [?]Help "); } else { Console.WriteLine("[T]avern [Y]our house [?]Help "); } Console.WriteLine("[C]haracter [L]evel Master [O]ther Places [Q]uit "); Utilities.ColourText(Colour.SPEAK, "\n\nWhat would you like to do?\n\n"); Utilities.EmbedColourText(Colour.TIME, Colour.TIME, Colour.TIME, Colour.TIME, "It is day ", $"{Time.day}", ", the ", $"{Time.weeks[Time.week]}", " week of ", $"{Time.months[Time.month]}", ", ", $"{Time.year}", "\n\n"); string choice = Console.ReadKey(true).KeyChar.ToString().ToLower(); if (choice == "w" && tutorial) { Shop.GameShop(Shop.WeaponShop, Create.p); } else if (choice == "a" && tutorial) { Shop.GameShop(Shop.ArmorShop, Create.p); } else if (choice == "d") { Explore.DungeonCheck(d, Create.p); } else if (choice == "i") { Shop.ItemShop(Create.p); } else if (choice == "?") { Utilities.Help(); } else if (choice == "c") { Utilities.CharacterSheet(Create.p); } else if (choice == "l") { LevelMaster.VisitLevelMaster(Create.p); } else if (choice == "t") { Tavern.Inn(Create.p); } else if (choice == "y") { House.YourHouse(Create.p); } else if (choice == "b" && tutorial && bank) { Bank.GameBank(Create.p); } else if (choice == "q") { Utilities.Quit(); } else if (choice == "x") { Create.p.xp += 50; Create.p.gold += 900; BlackJack.PlayBlackJack(); } else if (choice == "o") { OtherPlaces.Other(Create.p); } GameTown(); }
void Start() { LevelMaster.Start(); audioSrc = GetComponent <AudioSource>(); reloadingUI.SetActive(false); }
private void Awake() { lm = GameObject.FindGameObjectWithTag("Levelman").GetComponent <LevelMaster>(); move = GetComponent <GhostTrail>(); sA = GameObject.FindGameObjectWithTag("Special").GetComponent <SpecialAttack>().instance; }
public static void Start() { prime = new LevelMaster(); prime.bossHB = GameObject.FindWithTag("HealthbarObject").GetComponent <BigRatHB>(); prime.bossHB.gameObject.SetActive(false); }
public static void GameTown() { for (int i = 0; i < Time.Events.Count; i++) { if (Time.Events[i].name == "Bank Construction" && Time.Events[i].trigger && Time.Events[i].active) { bank = true; } } Console.Clear(); UI.Town(new string[] { "You are in the town of Marburgh", "It is a small town, but is clearly growing", "Who knows what will be here in a month?" }, adventureList, shopList, serviceList, otherList, adventureButton, shopButton, serviceButton, otherButton); string choice = Console.ReadKey(true).KeyChar.ToString().ToLower(); if (choice == "w" && tutorial) { Shop.GameShop(Shop.WeaponShop, Create.p); } else if (choice == "a" && tutorial) { Shop.GameShop(Shop.ArmorShop, Create.p); } else if (choice == "d") { Explore.DungeonCheck(d, Create.p); } else if (choice == "i") { Shop.ItemShop(Create.p); } else if (choice == "?") { Help.General(); } else if (choice == "c") { Utilities.CharacterSheet(Create.p); } else if (choice == "l") { LevelMaster.VisitLevelMaster(Create.p); } else if (choice == "t") { Tavern.Inn(Create.p); } else if (choice == "y") { House.YourHouse(Create.p); } else if (choice == "b" && tutorial && bank) { Bank.GameBank(Create.p); } else if (choice == "q") { Utilities.Quit(); } else if (choice == "x") { Create.p.xp += 30; Create.p.gold += 500; tutorial = true; Shop.itemShopOptionButton1.Add(Colour.ENHANCEMENT + "E" + Colour.RESET); Shop.itemShopOptionList1.Add("nhancement Machine"); } else if (choice == "o") { OtherPlaces.Other(Create.p); } GameTown(); }
void Start() { levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>(); StartCoroutine(startSpawn()); }