public void OnButtonDown()
        {
            MusicImpactEnum impact = (MusicImpactEnum)_Dropdown.value;
            float           time;

            if (!float.TryParse(_TimeInput.text, out time))
            {
                Debug.LogError("时间填写错误");
                return;
            }
            MusicData data = new MusicData();

            data.MusicImpact = impact;
            data.Time        = time;
            data.Position    = worldPos.ToStr();
            dataList.Add(data);
            DoSave();
            Hide();
        }
예제 #2
0
        private void ApplyImpact(MusicData data)
        {
            switch (data.MusicImpact)
            {
            case MusicImpactEnum.EnemyEntity:
                EntityManager.Inst.CreateEnemy <EnemyEntity>(data.Position.ToV2(), Vector2.right);
                break;

            case MusicImpactEnum.Enemy01Entity:
                EntityManager.Inst.CreateEnemy <Enemy01Entity>(data.Position.ToV2(), Vector2.right);
                break;

            case MusicImpactEnum.Enemy02Entity:
                EntityManager.Inst.CreateEnemy <Enemy02Entity>(data.Position.ToV2(), Vector2.right);
                break;

            case MusicImpactEnum.Enemy03Eneity:
                EntityManager.Inst.CreateEnemy <Enemy03Entity>(data.Position.ToV2(), Vector2.right);
                break;

            default:
                break;
            }
        }