public static int SFXSoundTypeToIndex(this SFXSoundType SFXsoundType) { switch (SFXsoundType) { default: return(0); case SFXSoundType.GameReady: return(1); case SFXSoundType.Failure: return(2); case SFXSoundType.Success: return(3); case SFXSoundType.ClickPositive: return(4); case SFXSoundType.ClickNegative: return(5); case SFXSoundType.MoverSpawn: return(6); case SFXSoundType.MoverTurn: return(7); case SFXSoundType.MoverJump: return(8); case SFXSoundType.MoverEnter: return(9); case SFXSoundType.MoverCrash: return(10); case SFXSoundType.ItemTouch: return(11); case SFXSoundType.InformSign: return(12); case SFXSoundType.ItemDrop: return(13); case SFXSoundType.CoinPickup: return(14); case SFXSoundType.CoinDrop: return(15); case SFXSoundType.BlockDrop: return(16); case SFXSoundType.AllClear: return(17); } }
protected IEnumerator RoutineShowUp(Transform transform, SFXSoundType effectType, float height, float time) { float from = transform.localPosition.y + height; float to = transform.localPosition.y; float elapsedTime = 0f; while (elapsedTime <= 1) { elapsedTime += Time.deltaTime / time; float h = Mathf.Lerp(from, to, elapsedTime.Interpolation(SmoothType.Exponential)); transform.localPosition = new Vector3(transform.localPosition.x, h, transform.localPosition.z); yield return(null); } AudioManager.Instance.PlaySFXSound(effectType); }
protected IEnumerator RoutineSetPosition(Vector3 targetPosition, SFXSoundType effectType) // 충돌 타겟의 중심 좌표까지 이동 { bool isOnEffect = false; Vector3 start = bodyTransform.position; Vector3 end = targetPosition; float elapsedTime = 0f; while (elapsedTime < 1f) { if (elapsedTime > 0.5f && isOnEffect == false) { AudioManager.Instance.PlaySFXSound(effectType); isOnEffect = true; } elapsedTime += Time.deltaTime / passTime; bodyTransform.position = Vector3.Lerp(start, end, elapsedTime.Interpolation(SmoothType.SmootherStep)); yield return(null); } }
protected IEnumerator DisplayPlusLife(GameObject note, TextMeshProUGUI life, SFXSoundType sfxSound, Identifier identifier) { GameDesignManager.Instance.AddLife(identifier); note.SetActive(true); float elapsedTime = 0f; bool isDisplayed = false; while (elapsedTime <= 2.5f) { if (elapsedTime >= 0.6 && isDisplayed == false) { isDisplayed = true; life.text = string.Format("{0}", GameDesignManager.Instance.GameLife); AudioManager.Instance.PlaySFXSound(sfxSound); } elapsedTime += Time.deltaTime; yield return(null); } note.SetActive(false); }