void Awake() { itemInfoMgr = Singleton.GetInstance("ItemsInfoMgr") as ItemsInfoMgr; audioMgr = Singleton.GetInstance("AudioMgr") as AudioMgr; networkMgr = Singleton.GetInstance("NetworkMgr") as NetworkMgr; //Add tools to list list_Tools.Add(new Tool_Handprint()); list_Tools.Add(new Tool_Bloodstain()); //alloc array m_bToolsActive = new bool[list_Tools.Count]; m_iToolResult = new int[list_Tools.Count]; }
void Awake() { if (Instance != this) { Destroy(gameObject); Debug.Log("DestroyedObjectPersist"); } else { DontDestroyOnLoad(gameObject); } audioMgr = GetComponent<AudioMgr>(); itemsInfoMgr = GetComponent<ItemsInfoMgr>(); networkMgr = GetComponent<NetworkMgr>(); toolMgr = GetComponent<ToolMgr>(); uiMgr = GetComponent<UIMgr>(); }
protected override void OnInit(bool isRebirth = false) { this.configMosterMainVo = BaseDataMgr.instance.GetMonsterMainData(this.npc_id); this.musicid = this.configMosterMainVo.music_id; AudioMgr.loadSoundBank_Skill(this.musicid, true, 0); if (this.configMosterMainVo == null) { ClientLogger.Warn("Ignore scaling, cannot found SysMonsterMainVo: " + this.npc_id); } else { this.DoScale(this.configMosterMainVo.scale); } base.OnInit(false); if (!base.IsMonsterCreep()) { } if (base.UnitType == UnitType.EyeUnit || base.IsMonsterCreep() || base.UnitType == UnitType.Soldier) { this.m_nServerVisibleState = 2; } }
public static void Init(ContentManager content) { _channelGroup = AudioMgr.CreateChannelGroup("group"); Title = AudioMgr.LoadStreamedSound(_musicDir + "Title"); Overworld = AudioMgr.LoadStreamedSound(_musicDir + "Overworld"); Battle = AudioMgr.LoadStreamedSound(_musicDir + "Battle"); FinalBattle = AudioMgr.LoadStreamedSound(_musicDir + "FinalBattle"); Blip = AudioMgr.LoadSound(_soundDir + "Blip"); Back = AudioMgr.LoadSound(_soundDir + "Back"); Hit = AudioMgr.LoadSound(_soundDir + "Hit"); Death = AudioMgr.LoadSound(_soundDir + "Death"); ArenaAppearEffect = AudioMgr.LoadSound(_soundDir + "ArenaAppearEffect"); Voice = AudioMgr.LoadSound(_soundDir + "Voice"); OpenGate = AudioMgr.LoadSound(_soundDir + "OpenGate"); OpenChest = AudioMgr.LoadSound(_soundDir + "OpenChest"); Heal = AudioMgr.LoadSound(_soundDir + "Heal"); NewGame = AudioMgr.LoadSound(_soundDir + "NewGame"); Win = AudioMgr.LoadSound(_soundDir + "Win"); Potion = AudioMgr.LoadSound(_soundDir + "Potion"); }
public void SubmitAnswer() { if (m_Solved) { return; } m_Solved = true; for (int i = 0; i < m_CurrentIndexes.Length; ++i) { if (m_CurrentIndexes[i] != i) { m_Solved = false; break; } } if (m_Solved) { if (Core.instance.BuiltInResources != null) { AudioMgr.PlaySound(Core.instance.BuiltInResources.SolvedPuzzleClip); } StartCoroutine(OpenDoor()); ScaleSequencer[] sequencers = FindObjectsOfType <ScaleSequencer>(); for (int i = 0; i < sequencers.Length; ++i) { sequencers[i].StopSequence(); } } else if (Core.instance.BuiltInResources != null) { AudioMgr.PlaySound(Core.instance.BuiltInResources.WrongSolutionClip); } }
void initParas() { var goHead = transform.GetChild(0); goPrepare = goHead.GetChild(2).gameObject; goLandlords = goHead.GetChild(3).gameObject; // imgHead = goHead.GetComponent<Image> (); labLeftNum = goHead.GetChild(1).GetComponent <Text> (); labPlayerName = goHead.GetChild(0).GetComponent <Text> (); var goOut = transform.GetChild(2); goOutCard = goOut.GetChild(0); labTips = transform.Find("labTips").GetComponent <Text> (); var pos = goOutCard.localPosition; _pxOutCard = pos.x; _pyOutCard = pos.y; adMgr = AudioMgr.getInstance(); var posP = goOutCard.parent.localPosition; _pxOut = posP.x; _pyOut = posP.y; }
private void Start() { instance = this; custom.master = PlayerPrefs.GetFloat("MasterVolume"); custom.music = PlayerPrefs.GetFloat("BGMVolume"); custom.voice = PlayerPrefs.GetFloat("VoiceVolume"); custom.sound = PlayerPrefs.GetFloat("SfxVolume"); audioMixer.GetFloat("MasterVolume", out preset.master); audioMixer.GetFloat("BGMVolume", out preset.music); audioMixer.GetFloat("VoiceVolume", out preset.voice); audioMixer.GetFloat("SfxVolume", out preset.sound); audioMixer.SetFloat("MasterVolume", custom.master); audioMixer.SetFloat("BGMVolume", custom.music); audioMixer.SetFloat("VoiceVolume", custom.voice); audioMixer.SetFloat("SfxVolume", custom.sound); // voice.audioSource.pitch = Time.timeScale; custom = preset; }
private void RealFinishLevel() { BgmPlayer.Instance.StopExBG(); bool flag = base.GameResult == TeamType.LM; if (Singleton <PvpManager> .Instance.IsInPvp) { flag = GameManager.IsVictory.Value; } if (!AudioMgr.Instance.isEffMute()) { if (flag) { AudioMgr.PlayUI("Play_Victory", null, false, false); } else { AudioMgr.PlayUI("Play_Defeat", null, false, false); } } this.MyCoroutineManager.StopAllCoroutine(); this.MyCoroutineManager.StartCoroutine(this.FinishLevel(), true); }
void initParas() { var goC = transform.Find("ndH/ndV/ndCard1").gameObject; goC.transform.SetParent(goMove.transform); var pos = goC.GetComponent <RectTransform>().anchoredPosition; _px = pos.x; _py = pos.y; Destroy(goC); var goL = transform.Find("goMedium/ndcard/ndCard2").gameObject; goL.transform.SetParent(goMove.transform); var posL = goL.GetComponent <RectTransform> ().anchoredPosition; _ply = posL.y; _plx = posL.x; Destroy(goL); var goR = transform.Find("goDes/ndcard/ndCard3").gameObject; goR.transform.SetParent(goMove.transform); var posR = goR.GetComponent <RectTransform> ().anchoredPosition; _prx = posR.x; Destroy(goR); _gameCount = 0; _bTouch = true; undoMgr = new MoveMgr(this); redoMgr = new MoveMgr(this); adMgr = AudioMgr.getInstance(); langMgr = LangMgr.getInstance(); tTrans = new Transform[] { transform.Find("ndH"), transform.Find("goMedium"), transform.Find("goDes") }; goChoice = transform.Find("goToggles"); goTips = transform.Find("tips").gameObject; reset(); }
static int Stop(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1) { AudioMgr obj = (AudioMgr)ToLua.CheckObject <AudioMgr>(L, 1); obj.Stop(); return(0); } else if (count == 2) { AudioMgr obj = (AudioMgr)ToLua.CheckObject <AudioMgr>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.Stop(arg0); return(0); } else if (count == 3) { AudioMgr obj = (AudioMgr)ToLua.CheckObject <AudioMgr>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); obj.Stop(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: AudioMgr.Stop")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public Button(GUIBase UI, String Txt, Font F, float TextOffsetX = 0, float TextOffsetY = -10) : base(UI) { ButtonText = Txt; FontObj = F; UI.AddElement(this); this.TextOffsetX = TextOffsetX; this.TextOffsetY = TextOffsetY; TextObj = new Text(); TextObj.Font = F; TextObj.Style = Text.Styles.Bold; TextObj.CharacterSize = 30; TextObj.DisplayedString = ButtonText; TextObj.Color = Color.Black; Rect = new RectangleShape(); Rect.OutlineColor = Color.Black; Rect.OutlineThickness = 4; Tick = AudioMgr.GetSound("tick.wav"); }
int[] m_iInputNum = new int[m_iMethodsNum]; //各Method的需求答案个数 void Awake() { uiMgr = Singleton.GetInstance("UIMgr") as UIMgr; toolMgr = Singleton.GetInstance("ToolMgr") as ToolMgr; audioMgr = Singleton.GetInstance("AudioMgr") as AudioMgr; Methods[0] = transform.FindChild("Method00"); Methods[1] = transform.FindChild("Method01"); m_iInputNum[0] = 1; m_iInputNum[1] = 2; for (int i = 0; i < m_iMethodsNum; i++) { InputFields[i] = Methods[i].GetComponentsInChildren<InputField>(); Btns_Confirm[i] = Methods[i].GetComponentInChildren<Button>(); int a = i; Btns_Confirm[i].onClick.AddListener(delegate () { Confirm(a); }); } }
public static void PlayBG(string eventstr, GameObject emitter = null, bool stop = false, bool notbreakprev = false) { if (AudioMgr.m_instance.isBgMute()) { return; } if (string.IsNullOrEmpty(eventstr)) { return; } if (emitter == null) { emitter = AudioMgr.Instance.gameObject; } if (stop && emitter != null) { AkSoundEngine.StopAll(emitter); } if (notbreakprev && emitter != null && AudioMgr.isPlaying(emitter)) { return; } AkSoundEngine.PostEvent(eventstr, emitter); }
private void Update() { if (Input.GetKeyUp(KeyCode.B)) { if (this.ggg == null) { this.ggg = new GameObject("testaudio......."); this.ggg1 = new GameObject("111111111111testaudio......."); } AkBankManager.LoadBank("SLiaonida", 0); AudioMgr.Play("Play_Liaonida_conj_1_Buff", null, false, false); } else if (Input.GetKeyUp(KeyCode.H)) { if (this.ggg != null) { AudioMgr.Stop(this.ggg); AudioMgr.Stop(this.ggg1); } } else if (Input.GetKeyUp(KeyCode.S)) { AudioMgr.setState(BgmPlayer.Instance.gameObject, "BGM", "Level03"); AudioMgr.trigger(BgmPlayer.Instance.gameObject, "Stingers"); } else if (Input.GetKeyUp(KeyCode.A)) { AudioMgr.Play("Play_Coin_Throw", BgmPlayer.Instance.gameObject, false, false); } if (this.eventObjList.Count > 0) { string eventstr = this.eventObjList[0].eventstr; GameObject eventobj = this.eventObjList[0].eventobj; this.eventObjList.RemoveAt(0); } }
IEnumerator Collect() { GetComponent <Animator>().enabled = false; if (ClipToPlayOnCollect != null) { AudioMgr.PlaySound(ClipToPlayOnCollect); } Renderer[] rends = GetComponentsInChildren <Renderer>(); for (int i = 0; i < rends.Length; ++i) { StartCoroutine(GameUtilities.DissolveMesh(rends[i], true, 0.75f)); } while (rends[rends.Length - 1].material.GetFloat("_Amount") < 1.0f) { yield return(null); } LevelMgr.instance.IncrementStateValue(StateToIncrement); Destroy(gameObject); }
void initParas() { goHandCard = transform.Find("goFirst/goHand/goCard"); lPlayer.Add(transform.Find("goFirst").GetComponent <Player> ()); lPlayer.Add(transform.Find("goSecond").GetComponent <Player> ()); lPlayer.Add(transform.Find("goThird").GetComponent <Player> ()); goTop = transform.Find("goTop"); for (int i = 0; i < 3; i++) { lCard.Add(new List <int> ()); lOutCard.Add(new List <int> ()); lPlayer[i].init(i); } goLeft = transform.Find("goFirst/goLeft"); goRight = transform.Find("goFirst/goRight"); goTips = transform.Find("goFirst/goTips"); goGloTips = transform.Find("goGloTips"); var pos = goHandCard.localPosition; _pxHandCard = pos.x; _pyHandCard = pos.y; playCardControl = new PlayCardControl(this); adMgr = AudioMgr.getInstance(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // All our music files reside in Content directory. AudioMgr.Init("Content"); // You can load pretty much any popular audio format. // I'd recommend .ogg for music, tho. var sound = AudioMgr.LoadStreamedSound("test.mp3"); sound.Looping = true; //sound.LowPass = 0.1f; //sound.Volume = 2; //sound.Pitch = 2; var channel = sound.Play(); /* * // Add some effects to the sound! :0 * channel.LowPass = 0.5f; * channel.Pitch = 2f; */ base.Initialize(); }
public static void InitAudioResPath(this AudioMgr mgr, Dictionary <string, string> dic) { dicAudioResPath = dic; }
/// <summary> /// UnloadContent will be called once per game and is the place to unload /// game-specific content. /// </summary> protected override void UnloadContent() { // TODO: Unload any non ContentManager content here AudioMgr.Unload(); }
// Use this for initialization void Start() { adMgr = AudioMgr.getInstance(); }
public static void Load() { MusicMain = AudioMgr.LoadStreamedSound("Music/ingame"); Step = AudioMgr.LoadSound("Sounds/step", FMOD.MODE._3D); }
void initParas() { adMgr = AudioMgr.getInstance(); }
public void OnRestartClick() { AudioMgr.PlayAudio(100, Guid.Empty); Bridge.RestartBattle(); m_losePanel.SetActive(false); }
private void LoadSoundBankEleBatOne() { AudioMgr.LoadBnk("Guide_A.bnk"); }
public void Awake() { _audioMgr = AudioMgr.Instance; }
protected override void OnDragDropRelease(GameObject surface) { if (surface != null) { ExampleDragDropSurface component = surface.GetComponent <ExampleDragDropSurface>(); if (component != null) { GameObject gameObject = NGUITools.AddChild(component.gameObject, this.prefab); gameObject.transform.localScale = component.transform.localScale; Transform transform = gameObject.transform; transform.position = UICamera.lastHit.point; if (component.rotatePlacedObject) { transform.rotation = Quaternion.LookRotation(UICamera.lastHit.normal) * Quaternion.Euler(90f, 0f, 0f); } NGUITools.Destroy(base.gameObject); Singleton <PvpRoomView> .Instance.IsLock = false; return; } } if (!this.cloneOnDrag) { this.mTouchID = -2147483648; if (this.mCollider != null) { this.mCollider.enabled = true; } UIDragDropContainer uIDragDropContainer = (!surface) ? null : NGUITools.FindInParents <UIDragDropContainer>(surface); if (uIDragDropContainer != null) { this.mTrans.parent = ((!(uIDragDropContainer.reparentTarget != null)) ? uIDragDropContainer.transform : uIDragDropContainer.reparentTarget); Vector3 localPosition = this.mTrans.localPosition; localPosition.z = 0f; this.mTrans.localPosition = localPosition; } else { this.mTrans.parent = this.mParent; } this.mParent = this.mTrans.parent; this.mGrid = NGUITools.FindInParents <UIGrid>(this.mParent); this.mTable = NGUITools.FindInParents <UITable>(this.mParent); if (this.mDragScrollView != null) { this.mDragScrollView.enabled = true; } NGUITools.MarkParentAsChanged(base.gameObject); if (this.mTable != null) { this.mTable.repositionNow = true; } if (this.mGrid != null) { this.mGrid.repositionNow = true; } } else { Singleton <PvpRoomView> .Instance.ReplaceMatchPosition(base.GetComponent <MatchItem>()); NGUITools.Destroy(base.gameObject); } Singleton <PvpRoomView> .Instance.IsLock = false; AudioMgr.PlayUI("Play_UI_Page", null, false, false); }
public override void OnSkillStartBegin(StartSkillAction action) { AudioMgr.Play("Play_Coin_Throw", this.unit.gameObject, false, false); }
public override void OnSkillStartBegin(StartSkillAction action) { AudioMgr.Play("Play_Box_Appear", this.unit.gameObject, false, false); AudioMgr.Play("Play_Businessman_Boxapr", this.unit.gameObject, false, false); }
/// <summary> /// UnloadContent will be called once per game and is the place to unload /// game-specific content. /// </summary> protected override void UnloadContent() { AudioMgr.Unload(); }
public static AudioPlayer PlayAudio(this AudioMgr mgr, string audioName, Transform target, System.Action <AudioClip> onAudioOver = null) { return(AudioMgr.Ins.PlayAudio(audioName, onAudioOver)?.SetTarget(target)); }
void Awake() { audioMgr = Singleton.GetInstance("AudioMgr") as AudioMgr; PanelInit(); }
void Awake() { Instance = this; }
public void OnNextClick() { AudioMgr.PlayAudio(100, Guid.Empty); Bridge.NextLevel(); m_winPanel.SetActive(false); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this); } else { if (this != instance) Destroy(this.gameObject); } }
public static AudioPlayer PlayAudio(this AudioMgr mgr, string audioName, Vector3 pos, System.Action <AudioClip> onAudioOver = null) { return(AudioMgr.Ins.PlayAudio(audioName, onAudioOver)?.SetPos(pos)); }
public void OnBackClick() { AudioMgr.PlayAudio(100, Guid.Empty); Bridge.LeaveBattle(); }
public void UpdateWhichRuleAudioClip() { StringBuilder sb = new StringBuilder(); var listRulesAudioClip = AudioClips.Where((x) => x.Label.Equals("List rules; which rule to change?")).FirstOrDefault(); var questionOnlyAudioClip = AudioClips.Where((x) => x.Label.Equals("Which rule to change?")).FirstOrDefault(); string audioDirectory = Path.Combine(DirectoryMgr.AudioClipsDirectory, "Ruleset"); string deviceDirectory = Path.Combine(DirectoryMgr.AudioClipsDirectory, DeviceName); if (listRulesAudioClip == null) { listRulesAudioClip = new AudioClip() { Category = "Ruleset", Label = "List rules; which rule to change?", Tooltip = "List rules; which rule to change?", ButtonColour = ColourHelper.QuestionColour }; AudioClips.Add(listRulesAudioClip); } if (questionOnlyAudioClip == null) { questionOnlyAudioClip = new AudioClip() { Category = "Ruleset", Label = "Which rule to change?", Tooltip = "Which rule to change?", ButtonColour = ColourHelper.QuestionColour }; AudioClips.Add(questionOnlyAudioClip); } List <string> clips = new List <string>(); switch (Rules.Count) { case 0: sb.Append("Currently I have no rules for the " + DeviceName + ".\n"); clips.Add(Path.Combine(deviceDirectory, String.Format("Currently I have no rules for the {0}", DeviceName))); break; case 1: sb.Append("OK, I have one rule for the " + DeviceName + ".\n"); sb.Append(Rules[0].StateText + "\n"); sb.Append("What would you like to change?"); clips.Add(Path.Combine(audioDirectory, "OK")); clips.Add(Path.Combine(deviceDirectory, String.Format("I have one rule for the {0}", DeviceName))); clips.Add(Rules[0].TriggerClip.StateAudioFile); clips.Add(Rules[0].ActionClip.StateAudioFile); clips.Add(Path.Combine(audioDirectory, "What would you like to change_")); break; default: string numberTxt = TextHelper.GetNumberText(Rules.Count); sb.Append("I have " + numberTxt + " rules for the " + DeviceName + ".\n"); sb.Append("Which rule would you like to change?"); questionOnlyAudioClip.StateText = sb.ToString(); questionOnlyAudioClip.StateAudioFile = AudioMgr.CombineAudioClips(clips); sb.Clear(); sb.Append("OK, I have " + numberTxt + " rules for the " + DeviceName + ".\n"); for (int i = 0; i < Rules.Count; i++) { sb.Append(TextHelper.GetRuleNumberText(i) + ": "); sb.Append(Rules[i].StateText + "\n"); } sb.Append("Which rule would you like to change?"); clips.Add(Path.Combine(audioDirectory, "OK")); clips.Add(Path.Combine(deviceDirectory, String.Format("I have " + numberTxt + " rules for the {0}", DeviceName))); for (int i = 0; i < Rules.Count; i++) { clips.Add(Path.Combine(audioDirectory, TextHelper.GetRuleNumberText(i))); clips.Add(Rules[i].TriggerClip.StateAudioFile); clips.Add(Rules[i].ActionClip.StateAudioFile); } clips.Add(Path.Combine(audioDirectory, "Which rule would you like to change_")); break; } listRulesAudioClip.StateText = sb.ToString(); listRulesAudioClip.StateAudioFile = AudioMgr.CombineAudioClips(clips); }
void Awake() { Instance = this; source.clip = tracks[0]; }