private void Start() { Instance = this; this.source = GetComponent <AudioSource>(); DontDestroyOnLoad(this.gameObject); SceneManager.LoadScene("MainMenu"); }
// Use this for initialization private void Awake() { if (_instance == null) { _instance = this; } }
// Use this for initialization void Start() { musicManager = GameObject.FindObjectOfType <BGMusic>(); volumeSlider.value = PlayerPrefsManager.GetMasterVolume(); difficultySlider.value = PlayerPrefsManager.GetDifficulty(); }
void Start() { bgMusic = FindObjectOfType <BGMusic> (); bgAudioSource = bgMusic.GetComponent <AudioSource> (); difficultySlider.value = PlayerPrefs.GetInt("difficulty"); volumeSlider.value = PlayerPrefs.GetFloat("volume"); }
void Start() { DontDestroyOnLoad(this.gameObject); cells = GetComponentsInChildren <PhoneLockScreen>(); cellCols = GetComponentsInChildren <BoxCollider>(); bgm = GameObject.FindGameObjectWithTag("BG Music").GetComponent <BGMusic>(); }
// Start is called before the first frame update void Awake() { procrastinatorStoredMove = Vector2Int.zero; gridMovement = gameObject.GetComponent <GridMovement>(); gridAnimator = gameObject.GetComponent <AnimateGridMovement>(); manager = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>(); entityTag = gameObject.GetComponent <EntityTag>(); SoundSystem = GameObject.FindGameObjectWithTag("SoundSystem"); speaker = SoundSystem.GetComponent <BGMusic>(); }
// Use this for initialization void Start() { for (int i = 0; i < (int)eMood.eMoodCount; ++i) { level1Players[i] = new BGMusic(level1Tracks[i], transform); level2Players[i] = new BGMusic(level2Tracks[i], transform); bassPlayers[i] = new BGMusic(bassTracks[i], transform); } oldBass = -1; }
private void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
private void JustMonika() { if (music == null) { music = this; DontDestroyOnLoad(gameObject); } else if (music != this) { Destroy(gameObject); } }
// Use this for initialization void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } }
// Use this for initialization void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
void Awake() { if ((instance != null) && (instance != this)) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }
private void Awake() { audioS = GetComponent <AudioSource>(); if (!instance) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
void Awake() { Debug.Log("My ID " + GetInstanceID()); if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } } //awake
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void Awake() { if (instance != null && instance != this) { DestroyImmediate(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
// Use this for initialization void Awake() { if (instance != null) { Destroy(gameObject); Debug.Log("destory BGMusic"); } else { instance = this; } GameObject.DontDestroyOnLoad(gameObject); }
void Awake() { if (_bgMusic == null) { _bgMusic = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }
void Awake() { RefreshPlayerPrefs(); if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if ((Instance != null && Instance != this) || SceneManager.GetActiveScene().name == "Map") { Destroy(this.gameObject); return; } else { Instance = this; } DontDestroyOnLoad(this.gameObject); }
void Awake() { if (_instance == null) { _instance = this; Screen.SetResolution(480, 840, false); DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
void Update() { collectCounter = playerMovement.collectCount; goalObj.GetComponent <Renderer> ().material.color = new Color(1, 1, 1, alpha); if (collectCounter == goal) { alpha = 1; } timer += Time.deltaTime; if (entered == true) { StartCoroutine(ScaleTime(1.0f, 0.0f, 1.0f)); //to reverse it: StartCoroutine(ScaleTime(0.0f, 1.0f, 1.0f)); //Non-LERP slow-mo /*timePct = new Vector3(Mathf.Lerp(1, 0, t), 0, 0); * timePct-= Time.deltaTime; * if (timePct < 0.0001f){ * timePct = 0; * }*/ } if (canProgress == true) { Debug.Log("2ay"); if (Input.GetButtonDown("Jump")) { Debug.Log("3ay"); SceneManager.LoadScene(nextLevel); BGM = FindObjectOfType <BGMusic>(); BGM.ChangeMusic(); } if (Input.GetButtonDown("Jump")) { Debug.Log("takeHOME"); SceneManager.LoadScene("lab"); BGM = FindObjectOfType <BGMusic>(); BGM.ChangeMusic(); } } }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } if (!AudioBegin) { PlayerPrefs.SetInt("tutorial", 1); PlayerPrefs.SetInt("efeitos", 1); PlayerPrefs.SetInt("musica", 1); GetComponent <AudioSource>().Play(); DontDestroyOnLoad(gameObject); AudioBegin = true; } }
void Start() { bgm = GameObject.FindGameObjectWithTag("BG Music").GetComponent <BGMusic>(); }
public override void DownLoadInformationFrmDevice(string DevName, int intActivePage, int DeviceType, int num1, int num2)// 0 mean all, else that tab only { string strMainRemark = DevName.Split('\\')[1].Trim(); String TmpDevName = DevName.Split('\\')[0].Trim(); byte SubNetID = byte.Parse(TmpDevName.Split('-')[0].ToString()); byte DeviceID = byte.Parse(TmpDevName.Split('-')[1].ToString()); byte[] ArayTmp = null; int wdMaxValue = DeviceTypeList.GetMaxValueFromPublicModeGroup(DeviceType); base.DownLoadInformationFrmDevice(DeviceName, intActivePage, DeviceType, num1, num2); IsBrdTemp = (arayTempBroadCast[1] == 1); String sBrdName = arayTempBroadCast[2].ToString() + "-" + arayTempBroadCast[3].ToString(); BrdDev = new DeviceInfo(sBrdName); if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy) { CsConst.calculationWorker.ReportProgress(25); } Byte FhLowLimit = 5; Byte FhHighLimit = 35; DLPAC = new ACSetting(); if (intActivePage == 0 || intActivePage == 2) { ModifyPageVisibleOrNotInformation(SubNetID, DeviceID, DeviceType); } if (intActivePage == 0 || intActivePage == 3) { DLPAC.DownloadACSettingFromDevice(SubNetID, DeviceID, DeviceType, ref AdjustValue, ref FhLowLimit, ref FhHighLimit); if (DLPFH == null) { DLPFH = new FloorHeating(); } DLPFH.minTemp = FhLowLimit; DLPFH.maxTemp = FhHighLimit; } else if (intActivePage == 0 || intActivePage == 4) { // music setup #region DLPMusic = new BGMusic(); if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x1930, SubNetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == true) { DLPMusic.bytEnable = CsConst.myRevBuf[25]; //背光时间 ,永远显示:0,其他 10-99s DLPMusic.bytCurZone = CsConst.myRevBuf[26]; //背光亮度 DLPMusic.bytMusicType = CsConst.myRevBuf[27]; //不跳转0,其他页面1-7 //otherInfo.bytGotoTime = CsConst.myRevBuf[28]; //20-150s CsConst.myRevBuf = new byte[1200]; } DLPMusic.ArayDevs = new byte[48]; ArayTmp = new byte[1]; for (byte bytI = 0; bytI < 2; bytI++) { ArayTmp[0] = bytI; if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x1934, SubNetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == true) { Array.Copy(CsConst.myRevBuf, 27, DLPMusic.ArayDevs, bytI * 24, 24); CsConst.myRevBuf = new byte[1200]; } } // read advance commands when playing DLPMusic.KeyTargets = new UVCMD.ControlTargets[14]; ArayTmp = new byte[1]; Byte bTotalMusic = 8; if (DLPPanelDeviceTypeList.DLPWithNewMusicSources.Contains(DeviceType)) // new music sources { bTotalMusic = 14; } for (byte bytI = 0; bytI < bTotalMusic; bytI++) { ArayTmp[0] = bytI; if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x195A, SubNetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == true) { DLPMusic.KeyTargets[bytI] = new UVCMD.ControlTargets(); DLPMusic.KeyTargets[bytI].ID = CsConst.myRevBuf[26]; DLPMusic.KeyTargets[bytI].Type = CsConst.myRevBuf[27]; DLPMusic.KeyTargets[bytI].SubnetID = CsConst.myRevBuf[28]; DLPMusic.KeyTargets[bytI].DeviceID = CsConst.myRevBuf[29]; DLPMusic.KeyTargets[bytI].Param1 = CsConst.myRevBuf[30]; DLPMusic.KeyTargets[bytI].Param2 = CsConst.myRevBuf[31]; DLPMusic.KeyTargets[bytI].Param3 = CsConst.myRevBuf[32]; DLPMusic.KeyTargets[bytI].Param4 = CsConst.myRevBuf[33]; CsConst.myRevBuf = new byte[1200]; } } #endregion } else if (intActivePage == 0 || intActivePage == 5) // 地热页面 { DLPFH = new FloorHeating(); if (DLPAC == null) { DLPAC = new ACSetting(); } DLPFH.DownloadFloorheatingsettingFromDevice(SubNetID, DeviceID, DeviceType, ref DLPAC.bytTempArea); } else if (intActivePage == 0 || intActivePage == 9) // LED颜色和快捷键页面 { //页面跳转信息 #region if (CsConst.mySends.AddBufToSndList(ArayTmp, 0xE138, SubNetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == true) { otherInfo.bytBacklightTime = CsConst.myRevBuf[25]; //背光时间 ,永远显示:0,其他 10-99s otherInfo.bytBacklight = CsConst.myRevBuf[26]; //背光亮度 otherInfo.bytGotoPage = CsConst.myRevBuf[27]; //不跳转0,其他页面1-7 otherInfo.bytGotoTime = CsConst.myRevBuf[28]; //20-150s otherInfo.AutoLock = CsConst.myRevBuf[30]; if (CsConst.mintMPTLDeviceType.Contains(DeviceType)) { otherInfo.bytLigthDelayState = CsConst.myRevBuf[31]; otherInfo.IRCloseTargets = CsConst.myRevBuf[32]; otherInfo.IRCloseSensor = CsConst.myRevBuf[33]; if (CsConst.myRevBuf[16] >= 0x15) { otherInfo.isHasSensorSensitivity = true; otherInfo.CloseToSensorSensitivity = CsConst.myRevBuf[34]; } else { otherInfo.isHasSensorSensitivity = false; } } CsConst.myRevBuf = new byte[1200]; } #endregion //白平衡 #region ArayTmp = null; if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x1998, SubNetID, DeviceID, false, false, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == true) { int num = wdMaxValue; if (CsConst.mintMPTLDeviceType.Contains(DeviceType)) { arayButtonBalance = new byte[12 * 3 + 1]; num = 12; } for (int i = 1; i <= num; i++) { arayButtonBalance[0] = Convert.ToByte(i); Array.Copy(CsConst.myRevBuf, 25 + (i - 1) * 3, arayButtonBalance, (i - 1) * 3 + 1, 3); } } #endregion //睡眠模式 #region if (DeviceType == 175 || DeviceType == 180 || DeviceType == 5004) { araySleep = new byte[6]; if (CsConst.mySends.AddBufToSndList(ArayTmp, 0xE4FA, SubNetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == true) { araySleep[0] = 1; Array.Copy(CsConst.myRevBuf, 25, araySleep, 1, 5); CsConst.myRevBuf = new byte[1200]; } } MyRead2UpFlags[9] = true; #endregion // LED颜色和快捷键 #region arayButtonColor = new byte[387]; for (int i = 0; i <= 7; i++) { ArayTmp = new byte[1]; ArayTmp[0] = Convert.ToByte(i); if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x198C, SubNetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == true) { arayButtonColor[0] = Convert.ToByte(i); if (i == 0) { Array.Copy(CsConst.myRevBuf, 26, arayButtonColor, 1, 8); } else { Array.Copy(CsConst.myRevBuf, 26, arayButtonColor, (i - 1) * 54 + 9, 54); } CsConst.myRevBuf = new byte[1200]; HDLUDP.TimeBetwnNext(10); } } #endregion } if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy) { CsConst.calculationWorker.ReportProgress(100); } }
void Awake() { bgmusic = this.gameObject.GetComponent <BGMusic>(); }
void Awake() { PlayerPrefs.SetInt("fromActs", 0); //PlayerPrefs.SetInt("Set4", 0); bgmusic = GameObject.Find("MusicManager").GetComponent <BGMusic>(); }
private void Start() { instance = this; }