protected virtual void CheckResult() { m_answer = m_sObjs.FirstOrDefault(a => a.id == selectedId); bool result = CheckMatch(m_answer); if (onLevelComplete != null) { onLevelComplete(result); } AudioMng.PlayOneShot(m_answer.selectionData.clip); if (!result) { m_isRestarting = true; wallTrans.DOMoveY(m_wallStartPos.y, 1f) .SetEase(Ease.OutQuad) .OnComplete(() => m_isRestarting = false); CameraShake.ShakeAll(); } else { GameOver(); } }
public void Attack(Animator _objAnimator) { Debug.Log("isNormalAtking = " + isNormalAtking); //Debug.Log("waitingTimeForAtk = " + waitingTimeForAtk); //Debug.Log("elapsedTimeAfterAtk = " + elapsedTimeAfterAtk); //isAtking은 코루틴에서 시간 계산 후 false값이 들어가도록 설정. if (!isNormalAtking) { isLeavingMeshElapseTime = true; switch (Random.Range(0, 2)) { case 0: AudioMng.GetInstance().PlaySound("AttackSound_1", objTr.position, 100f); break; case 1: AudioMng.GetInstance().PlaySound("AttackSound_2", objTr.position, 100f); break; case 2: AudioMng.GetInstance().PlaySound("AttackSound_3", objTr.position, 100f); break; } elapsedTimeAfterAtk = 0.0f; isNormalAtking = true; //애니 이벤트로 NormalAttack 실행 _objAnimator.SetTrigger("NormalAtk"); } }
protected virtual void Start() { foreach (var a in ambients) { AudioMng.Play(a); } }
private void Awake() { if (Instance == null) { Instance = this; } gameConfig.Init(this); inputSetting.Init(this); mainGame.Init(this); resultMng.Init(this); debug.Init(); dxCentre.Init(); dxTextCentre.Init(); dxHeatmapPanel.Init(); // dxErrorPopup.Init(); dxLoadingPanel.Init(); systemCam.gameObject.SetActive(false); AudioMng.Init(); IsInit = true; }
private void Start() { currentES = FindObjectOfType <EventSystem>(); fadeCtrl = GetComponentInChildren <FadeController>(); audioMng = GameManager.I_GM.AudioManager; isGameStarted = false; }
public override void Die() { IsDead = true; if (nav) { nav.isStopped = true; } enemyTakingDamage.IsDead = true; // Animation animator.SetTrigger("Death"); // Drop Item this.GetComponent <DropTable>().GetRandomItem(); if (listStrDeathSound.Capacity > 0) { int rand = Random.Range(0, listStrDeathSound.Capacity - 2); AudioMng.GetInstance().PlaySound(listStrDeathSound[rand], this.transform.position, 120f); } // Destroy Destroy(this.gameObject, animator.GetCurrentAnimatorStateInfo(0).length + 1); }
public override void Attack(Animator _objAnimator) { //isAtking은 코루틴에서 시간 계산 후 false값이 들어가도록 설정. if (!isAtking) { canAttack = true; switch (Random.Range(0, 2)) { case 0: AudioMng.GetInstance().PlaySound("AttackSound_1", objTr.position, 100f); break; case 1: AudioMng.GetInstance().PlaySound("AttackSound_2", objTr.position, 100f); break; case 2: AudioMng.GetInstance().PlaySound("AttackSound_3", objTr.position, 100f); break; } elapsedTimeAfterAtk = 0.0f; isAtking = true; //애니 이벤트로 WeaponAttack 실행 _objAnimator.SetTrigger("Attack"); } }
void Start() { Screen.SetResolution(1920, 1080, FullScreenMode.FullScreenWindow); phase = 0; level = 0; AudioMng.Play(bgm); InitLevel(true); }
public static AudioMng GetInstance() { if (!instance) { instance = GameObject.FindObjectOfType(typeof(AudioMng)) as AudioMng; if (!instance) { Debug.LogError("AudioMng instance is Null,, Cant Find GameObject what have AuudioMng"); } } return(instance); }
public void Die() { Vector3 newPos = this.transform.position; Quaternion quater = this.transform.rotation; newPos.y += 1f; Instantiate(ParticleMng.GetInstance().EffectSmallExp(), newPos, quater); AudioMng.GetInstance().PlaySound("PlayerDie", newPos, 100f); Destroy(gameObject); GameMng.Instance.GameOver(); }
protected override void GameOver() { m_isGameOver = true; AudioMng.PlayOneShot(m_answer.selectionData.clip); GameData.LevelSkip = m_answer.levelSkip; //FIXME: I need the true symbol! GameData.SymbolSprites.Add((m_isWin) ? successSymbol : breakupSymbol); GameData.IsBreakup = !m_isWin; StartCoroutine(EndGameDelay()); }
public void Update() { if (PhaseState != PhaseStates.Playing) { return; } if (!m_isFinished) { if (Input.GetMouseButtonDown(0)) { Index++; AudioMng.PlayOneShot(successSnd); } } }
IEnumerator TestRoutine() { startDirector.Play(); yield return(new WaitUntil(() => startDirector.time >= startDirector.duration)); waitInputDirector.Play(); yield return(new WaitUntil(() => m_input)); endInputDirector.Play(); yield return(new WaitUntil(() => endInputDirector.time >= endInputDirector.duration)); AudioMng.Play(startGameSnd); GameData.SymbolSprites.Add(startObj.selectionData.symbolSpr); PhaseState = PhaseStates.End; }
private IEnumerator coroutineSpawn() { int count = 8; while (count > 0) { Vector3 newPos = tr.position; int rand = Random.Range(0, enemyPrefab.Capacity); newPos.x += 3f * Mathf.Cos(count * 45f * Mathf.Deg2Rad); newPos.z += 3f * Mathf.Sin(count * 45f * Mathf.Deg2Rad); Instantiate(enemyPrefab[rand], newPos, tr.rotation); Instantiate(ParticleMng.GetInstance().EffectPlasmaExp(), newPos, tr.rotation); AudioMng.GetInstance().PlaySound("MoveIn", tr.position, 100f); --count; yield return(new WaitForSeconds(0.15f)); } Destroy(this.gameObject); }
protected virtual void CheckResult() { m_answer = m_sObjs.FirstOrDefault(a => a.id == selectedId); m_isWin = CheckMatch(m_answer); WallState += dialogDatas[ChatDialogState].wallStateEffect; chatDialogSpr.sprite = dialogDatas[m_chatDialogState].GetRandomSpr(); AudioMng.PlayOneShot(dialogDatas[ChatDialogState].feedbackClip); if (onLevelComplete != null) { onLevelComplete(m_isWin); } // End game if no more try m_tryLeft--; if (m_tryLeft <= 0) { GameOver(); return; } if (!m_isWin) { m_isRestarting = true; wallTrans.DOMoveY(m_wallStartPos.y, 1f) .SetEase(Ease.OutQuad) .OnComplete(() => m_isRestarting = false); } else { GameOver(); } }
private void Awake() { settingData = Resources.Load <TGSettingData>("SettingData"); if (settingData == null) { ErrorQuit("缺少Setting Data文件!务必确保Resources文件夹底下有SettingData"); return; } Instance = this; gameConfig.Init(this); inputSetting.Init(this); mainGame.Init(this); resultMng.Init(this); dxCentre.OnInit(this); dxTextCentre.OnInit(this); dxHeatmapPanel.OnInit(this); #if UNITY_EDITOR RootPath = Application.dataPath + "/TGFramework/"; #else RootPath = Application.dataPath.Replace(Application.productName + "_Data", string.Empty); #endif fileWriter.Init(RootPath); GameNameCn = settingData.gameNameCn; systemCam.gameObject.SetActive(false); AudioMng.Init(); IsInit = true; }
protected virtual void OnChangePhaseStates(PhaseStates phaseState) { m_phaseState = phaseState; Debug.Log("Phase State: " + m_phaseState); if (onPhaseStateChanged != null) { onPhaseStateChanged(m_phaseState); } if (m_phaseState == PhaseStates.Start) { PhaseState = PhaseStates.Playing; } if (m_phaseState == PhaseStates.End) { foreach (var a in ambients) { AudioMng.Stop(a); } } }
void Start() { m_inst = this; }
private void OnTriggerEnter(Collider other) { if (!isDead) { if (opponentObjAtkTagName == null) { Debug.LogError("WeaponTag Name is null"); } if (other.tag == opponentObjAtkTagName) { float weaponDamage = other.gameObject.GetComponent <NeedWeaponThingsForSystem>().Damage; CharacterStat objStat = this.gameObject.GetComponent <CharacterStat>(); WeaponMeshCtrl meshCtrl = other.GetComponent <WeaponMeshCtrl>(); //Weapon의 메쉬일 경우 if (meshCtrl.IsWeaponMesh) { Weapon weapon = null; if (meshCtrl) { weapon = meshCtrl.WeaponGameObject; } else { weapon = other.GetComponent <ProjectileCtrl>().WeaponGameObject; } Vector3 newPos = tr.position; newPos.y += 1f; // Paticle Instantiate(ParticleMng.GetInstance().EffectBulletImpactWood(), newPos, tr.rotation); Instantiate(ParticleMng.GetInstance().EffectBulletImpactMetal(), newPos, tr.rotation); if (weapon.listSoundName.Capacity > 0) { int rand = Random.Range(0, weapon.listSoundName.Count); AudioMng.GetInstance().PlaySound(weapon.listSoundName[rand], this.transform.position, 120f); } if (!isAttacked && meshCtrl) { isAttacked = true; weapon.SubtractDurability(); } // Combo ComboSystemMng.GetInstance().AddCombo(50f); // Taking Damage objStat.TakeDamage(weaponDamage); } //노멀 어택의 메쉬인 경우 else { NormalAtkCtrl normalAtkCtrl = other.GetComponent <NormalAtkCtrl>(); Vector3 newPos = tr.position; newPos.y += 1f; // Paticle Instantiate(ParticleMng.GetInstance().EffectBulletImpactWood(), newPos, tr.rotation); Instantiate(ParticleMng.GetInstance().EffectBulletImpactMetal(), newPos, tr.rotation); //경훈이가 만들었는데 사운드 부분이여서 일단 자름 //if (normalAtkCtrl.listSoundName.Capacity > 0) //{ // int rand = Random.Range(0, normalAtkCtrl.listSoundName.Count); // AudioMng.GetInstance().PlaySound(normalAtkCtrl.listSoundName[rand], this.transform.position, 120f); //} if (!isAttacked) { isAttacked = true; } // Combo ComboSystemMng.GetInstance().AddCombo(50f); // Taking Damage objStat.TakeDamage(weaponDamage); } } } }
private void Update() { int slotNumber = 0; Item it = null; bool isPressedNumber = false; if (Input.GetKeyDown(KeyCode.F) && slot.IsCanPickUpItem()) { pickup.CheckItemInArea(tr.position); } if (Input.GetKeyDown(KeyCode.Alpha1)) { slotNumber = 0; isPressedNumber = true; } else if (Input.GetKeyDown(KeyCode.Alpha2)) { slotNumber = 1; isPressedNumber = true; } else if (Input.GetKeyDown(KeyCode.Alpha3)) { slotNumber = 2; isPressedNumber = true; } else if (Input.GetKeyDown(KeyCode.Alpha4)) { slotNumber = 3; isPressedNumber = true; } else if (Input.GetKeyDown(KeyCode.Alpha5)) { slotNumber = 4; isPressedNumber = true; } if (isPressedNumber) { isPressedNumber = false; // 그리고 누른 번호에 해당하는 슬롯의 정보를 현재 장착슬롯에 적용및 누른번호에 해당하는 슬롯에 대한 정보 소거 // 따로 빼낸 정보를 슬롯에 추가 AudioMng.GetInstance().PlaySound("Button1", tr.position, 100f); // 현재 낀 아이템이 있는지 체크 if (equipment.IsEquipWeapon) { Item itMain = equipment.UnEquip(); it = slot.GetItemListNumber(slotNumber); it.gameObject.SetActive(true); slot.RemoveItemMain(); slot.AddItemMain(slot.ItemList[slotNumber]); slot.RemoveItemInNumber(slotNumber); slot.AddItem(slotNumber, itMain); equipment.Equip(it); } else { slot.RemoveItemMain(); it = slot.GetItemListNumber(slotNumber); slot.AddItemMain(it); slot.RemoveItemInNumber(slotNumber); slot.AddItemEmpty(slotNumber); equipment.Equip(it); } } }
public static void Init() { Instance = FindObjectOfType <AudioMng>(); }
void Awake() { Instance = this; }
public void Awake() { I_GM = this; ChosenSetting = Instantiate(DefaultDebug); AudioManager = GetComponentInChildren <AudioMng>(); }