void Start() { //PlayerPrefs.SetInt(currentPlayer + "Coins", 600); hideAll(); loadPlayerInfo(); menuinicio.SetActive(true); barraJugador.SetActive(true); PlayerPrefs.SetInt("RaceBegin", 0); PlayerPrefs.SetFloat("RaceClock", 0); audio = FindObjectOfType <MenuAudio>(); int car2 = PlayerPrefs.GetInt(currentPlayer + "StoreObjectActive1", 0); int car3 = PlayerPrefs.GetInt(currentPlayer + "StoreObjectActive2", 0); if (car2 == 1 || car3 == 1) { PlayerPrefs.SetInt(currentPlayer + "StoreObjectActive0", 0); } else { PlayerPrefs.SetInt(currentPlayer + "StoreObjectActive0", 1); } PlayerPrefs.SetInt(currentPlayer + "StoreObject0", 1); }
void Start() { player.startAmmo = startAmmo; maxCoins = coins.childCount; playerCheckpoint = player.transform.position; audio = FindObjectOfType <MenuAudio>(); }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; StartCoroutine(PlaySong()); } }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void PersistCheck() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
private void Awake() { if (instance == null) { instance = this; } else { Debug.LogWarning("More than one instance of MenuAudio was found!"); Destroy(this); } }
void Start() { ads = GameObject.Find("AdsManager").GetComponent <AdsManager>(); audio = GameObject.Find("AudioManager").GetComponent <MenuAudio>(); resolutions = Screen.resolutions; for (int i = 0; i < resolutions.Length; i++) { if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height) { Screen.SetResolution(resolutions[i].width, resolutions[i].height, true); } } advertisementUI.SetActive(false); player = GameObject.Find("Player").GetComponent <Player>(); }
public Menu(string MediaDir, TgcD3dInput input) { menuAudio = new MenuAudio(MediaDir, input); menuInstrucciones = new MenuInstrucciones(MediaDir, input); menuControles = new MenuControles(MediaDir, input); menuOpciones = new MenuOpciones(MediaDir, input); MenuPrincipal = new MenuPrincipal(MediaDir, input); estaEnMenu = true; this.setMenuPrincipal(); this.playSonidoAmbiente = true; this.playSonidoDisparos = true; this.playSonidoMenu = true; }
void Start() { muteBtn.SetActive(true); unMuteBtn.SetActive(false); audio = GameObject.Find("AudioManager").GetComponent <MenuAudio>(); bestScore.text = "BEST: " + Mathf.Round(PlayerPrefs.GetFloat("BestScore", 0)).ToString(); resolutions = Screen.resolutions; audio.play(); for (int i = 0; i < resolutions.Length; i++) { if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height) { Screen.SetResolution(resolutions[i].width, resolutions[i].height, true); } } }
// Start is called before the first frame update void Start() { audio = GameObject.Find("AudioManager").GetComponent <MenuAudio>(); colorMat = GetComponent <Renderer>(); offSet = new Vector3(0, 1, -3); death = GameObject.Find("DeathSound").GetComponent <DeathAudio>(); bestScore = Mathf.Round(PlayerPrefs.GetFloat("BestScore", 0)); runParticle.SetActive(true); overParticle.SetActive(false); Time.timeScale = 1; controller = GetComponent <CharacterController>(); uimanager = GameObject.Find("Canvas").GetComponent <UIManager>(); minSpeed = currentSpeed; time = 0; Camera.main.transform.parent = this.gameObject.transform; }
void Awake() { if (instance == null) { instance = this; audio = GetComponent <AudioSource>(); if (gameOver) { play(); } DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
public void Start() { if (!buttons) { if (MenuAudio.Instance == null) { MenuAudio.Instance = this; } else { Destroy(this.gameObject); } DontDestroyOnLoad(this.gameObject); SceneManager.sceneLoaded += OnSceneLoaded; } }
// Start is called before the first frame update void Awake() { if (tocarAudio) { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); } else { gameObject.SetActive(false); } }
public void cambiarTextura(MenuAudio menu, string MediaDir, string texture) { menu.onSonidoAmbiente.cambiarTextura(MediaDir, texture); }
private void Start() { audio = FindObjectOfType <MenuAudio>(); }
private void Start() { playerRect = GetComponent <RectTransform>(); axis = GetComponent <InputPlayerAxis>(); menuAudio = menuAudioObject.GetComponent <MenuAudio>(); }
// Use this for initialization void Start() { menuAudio = GameObject.Find ("GUI Background").GetComponent<MenuAudio> (); scorekeeper = GameObject.Find ("Scorekeeper").GetComponent<Scorekeeper>(); photonView.RPC("SetScore", PhotonTargets.AllBuffered, PhotonNetwork.player.ID, 0); overlayCanvas = transform.GetComponentsInChildren<Canvas>().First(x => x.gameObject.name == "Common Area Overlay"); mainCanvas = transform.GetComponentsInChildren<Canvas>().First(x => x.gameObject.name == "Main Canvas"); handCanvas = transform.GetComponentsInChildren<Canvas>().First(x => x.gameObject.name == "Hand Canvas"); // disables our overlay for other people, so they do not see our score, move, and other values if(photonView.isMine) { overlayCanvas.enabled = true; mainCanvas.enabled = true; photonView.RPC("DisableCanvas", PhotonTargets.OthersBuffered, overlayCanvas.gameObject.GetPhotonView().viewID); photonView.RPC("DisableCanvas", PhotonTargets.OthersBuffered, mainCanvas.gameObject.GetPhotonView().viewID); photonView.RPC("DisableCanvas", PhotonTargets.OthersBuffered, handCanvas.gameObject.GetPhotonView().viewID); } handSizeIncreaseLevels = new int[3]{10, 25, 50}; turnPhase = Toolbox.TurnPhase.Move; handCamera = GameObject.Find ("Hand Camera").GetComponent<Camera>(); mainCamera = GameObject.Find ("Main Camera").GetComponent<Camera>(); handCanvas.worldCamera = handCamera; mainCanvas.worldCamera = mainCamera; mainCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "View Hand Button").onClick.AddListener(() => { ArrangeHand(0); }); mainCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "View Hand Button").onClick.AddListener(() => { Manager.ChangeCameras("Hand"); }); handCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "Return To Game Button").onClick.AddListener(() => { Manager.ChangeCameras("Main"); }); handCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "View Next").onClick.AddListener(() => { ArrangeHand(1); }); handCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "View Prev").onClick.AddListener(() => { ArrangeHand(-1); }); player = transform.GetChild (0); //portal hex is the seventh child of green tile zero. portalHex = GameObject.Find("Green Tile 0").transform.GetChild(6).gameObject; destroyedCards = GameObject.Find ("Destroyed Cards"); onHex = portalHex.GetComponent<HexScript>(); player.position = portalHex.transform.position; attackLabel = GetComponentInChildren<Canvas>().transform.GetComponentsInChildren<Text>().First(x => x.gameObject.name == "Attack Label").gameObject; blockLabel = GetComponentInChildren<Canvas>().transform.GetComponentsInChildren<Text>().First(x => x.gameObject.name == "Block Label").gameObject; timerLabel = GetComponentInChildren<Canvas>().transform.GetComponentsInChildren<Text>().First(x => x.gameObject.name == "Timer").gameObject; retreatLabel = GetComponentInChildren<Canvas>().transform.GetComponentsInChildren<Text>().First(x => x.gameObject.name == "Retreat Label").gameObject; usesLabel = GetComponentInChildren<Canvas>().transform.GetComponentsInChildren<Text>().First(x => x.gameObject.name == "Uses Remaining").gameObject; turnPhaseLabel = mainCanvas.transform.GetComponentsInChildren<Text>().First(x => x.gameObject.name == "Phase Label").gameObject; deckSizeLabel = GetComponentInChildren<Canvas>().transform.GetComponentsInChildren<Text>().First(x => x.gameObject.name == "Deck Size Label").gameObject; attackLabel.SetActive(false); blockLabel.SetActive(false); hand = handCanvas.transform.GetComponentsInChildren<Transform>().First(x => x.gameObject.name == "Hand").gameObject; deck = transform.GetComponentsInChildren<Transform>().First (x => x.gameObject.name == "Deed Deck").gameObject; energyLabel = transform.GetComponentsInChildren<Transform>().First (x => x.gameObject.name == "Energy Label").gameObject; handSizeLabel = transform.GetComponentsInChildren<Transform>().First (x => x.gameObject.name == "Hand Size Label").gameObject; armorLabel = transform.GetComponentsInChildren<Transform>().First (x => x.gameObject.name == "Armor Label").gameObject; fameLabel = transform.GetComponentsInChildren<Transform>().First (x => x.gameObject.name == "Fame Track").gameObject; discardPile = transform.GetComponentsInChildren<Transform>().First (x => x.gameObject.name == "Discard Pile").gameObject; InitDeckAndHand(); ArrangeHand(0); endMovesButton = mainCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "End Move Button"); endMovesButton.onClick.AddListener(() => Manager.SwitchToTurnPhase(Toolbox.TurnPhase.Action)); endActionButton = mainCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "End Action Button"); endActionButton.onClick.AddListener(() => Manager.SwitchToTurnPhase(Toolbox.TurnPhase.End)); interactButton = mainCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "Interaction Button"); interactButton.onClick.AddListener(() => PrepInteractionMenu()); restButton = mainCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "Rest Button"); restButton.onClick.AddListener(() => DoRest()); provokeButton = mainCanvas.transform.GetComponentsInChildren<Button>().First(x => x.gameObject.name == "Provoke Button"); provokeButton.onClick.AddListener(() => ProvokeRampagers()); ShowProvokeButton(false); ShowRestButton(false); ShowInteractionButton(false); ShowActionButton(false); UpdateLabels(); }
public void cambiarTextura(MenuAudio menu, string MediaDir, string texture) { menu.onSonidoDisparos.cambiarTextura(MediaDir, texture); }