示例#1
0
        static Automation()
        {
            // 파라미터 enum 쪼개기
            var enumValues = System.Enum.GetValues(typeof(TargetParam));
            var enumCount  = enumValues.Length;

            s_targetParamEnumList = new TargetParam[enumCount];
            for (int i = 0; i < enumCount; i++)
            {
                s_targetParamEnumList[i] = (TargetParam)enumValues.GetValue(i);
            }


            // 기본값 설정

            s_defaultValues = new Dictionary <TargetParam, float>();
            s_defaultValues[TargetParam.Volume] = 1.0f;
            s_defaultValues[TargetParam.LowCut] = 0.0f;



            // * 검증 코드. TargetParam마다 모두 기본값이 있어야한다.
            foreach (var key in s_targetParamEnumList)
            {
                if (!s_defaultValues.ContainsKey(key))
                {
                    throw new System.InvalidProgramException("default value for TargetParam." + System.Enum.GetName(typeof(TargetParam), key) + "is not set.");
                }
            }

            // 빌트인 오토메이션 만들기

            var auto_fadein = new Automation();

            auto_fadein.targetParam = TargetParam.Volume;
            auto_fadein.AddPoint(0, 0);
            auto_fadein.AddPoint(1, 1);
            LinearFadeIn = auto_fadein;

            var auto_fadeout = new Automation();

            auto_fadeout.targetParam = TargetParam.Volume;
            auto_fadeout.AddPoint(0, 1);
            auto_fadeout.AddPoint(1, 0);
            LinearFadeOut = auto_fadeout;

            var auto_instmute = new Automation();

            auto_instmute.targetParam = TargetParam.Volume;
            auto_instmute.AddPoint(0, 0);
            InstantMute = auto_instmute;

            var auto_instunmute = new Automation();

            auto_instunmute.targetParam = TargetParam.Volume;
            auto_instunmute.AddPoint(0, 1);
            InstantUnMute = auto_instunmute;
        }
示例#2
0
    // Use this for initialization
    void Start()
    {
        var intro_vol			= new Automation();
        intro_vol.targetParam	= Automation.TargetParam.Volume;
        intro_vol.AddPoint(0, 0);
        intro_vol.AddPoint(0.5f, 1);
        intro_vol.AddPoint(1.0f, 1);

        Output(intro_vol);

        var intro_lowcut		= new Automation();
        intro_lowcut.targetParam	= Automation.TargetParam.LowCut;
        intro_lowcut.AddPoint(0, 1);
        intro_lowcut.AddPoint(0.5f, 1);
        intro_lowcut.AddPoint(0.5f, 0);
        intro_lowcut.AddPoint(1, 0);

        Output(intro_lowcut);
    }
示例#3
0
        public static TransitionScenario GenTestScenario()
        {
            var scen = new TransitionScenario();

            var intro_vol = new Automation();

            intro_vol.targetParam = Automation.TargetParam.Volume;
            intro_vol.AddPoint(0, 0);
            intro_vol.AddPoint(1, 1);
            scen.AddIntroAutomation(intro_vol);

            var outro_vol = new Automation();

            outro_vol.targetParam = Automation.TargetParam.Volume;
            outro_vol.AddPoint(1, 0);
            outro_vol.AddPoint(0, 1);
            scen.AddOutroAutomation(outro_vol);

            return(scen);
        }
示例#4
0
        static Automation[] TestAutomation()
        {
            var tenauto1 = new Automation();

            tenauto1.targetParam = Automation.TargetParam.Volume;
            tenauto1.AddPoint(0, 0);
            tenauto1.AddPoint(0.75f, 1);

            var tenauto2 = new Automation();

            tenauto2.targetParam = Automation.TargetParam.Volume;
            tenauto2.AddPoint(0, 0);
            tenauto2.AddPoint(0.25f, 0);
            tenauto2.AddPoint(0.5f, 1);

            var tenauto3 = new Automation();

            tenauto3.targetParam = Automation.TargetParam.Volume;
            tenauto3.AddPoint(0, 0);
            tenauto3.AddPoint(0.5f, 0);
            tenauto3.AddPoint(1f, 1);

            return(new Automation[] { tenauto1, tenauto2, tenauto3 });
        }
示例#5
0
        public static TransitionScenario GenTestScenario2()
        {
            var scen				= new TransitionScenario();

            var intro_vol			= new Automation();
            intro_vol.targetParam	= Automation.TargetParam.Volume;
            intro_vol.AddPoint(0, 0);
            intro_vol.AddPoint(0.5f, 1);
            intro_vol.AddPoint(1.0f, 1);
            scen.AddIntroAutomation(intro_vol);
            var intro_lowcut		= new Automation();
            intro_lowcut.targetParam	= Automation.TargetParam.LowCut;
            intro_lowcut.AddPoint(0, 1);
            intro_lowcut.AddPoint(0.5f, 1);
            intro_lowcut.AddPoint(0.5f, 0);
            intro_lowcut.AddPoint(1, 0);
            scen.AddIntroAutomation(intro_lowcut);

            var outro_vol			= new Automation();
            outro_vol.targetParam	= Automation.TargetParam.Volume;
            outro_vol.AddPoint(0, 1);
            outro_vol.AddPoint(0.5f, 1);
            outro_vol.AddPoint(1, 0);
            scen.AddOutroAutomation(outro_vol);
            var outro_lowcut		= new Automation();
            outro_lowcut.targetParam	= Automation.TargetParam.LowCut;
            outro_lowcut.AddPoint(0, 0);
            outro_lowcut.AddPoint(0.5f, 0);
            outro_lowcut.AddPoint(0.5f, 1);
            outro_lowcut.AddPoint(1, 1);
            scen.AddOutroAutomation(outro_lowcut);

            return scen;
        }
示例#6
0
        static Automation[] TestAutomation()
        {
            var tenauto1			= new Automation();
            tenauto1.targetParam	= Automation.TargetParam.Volume;
            tenauto1.AddPoint(0, 0);
            tenauto1.AddPoint(0.75f, 1);

            var tenauto2			= new Automation();
            tenauto2.targetParam	= Automation.TargetParam.Volume;
            tenauto2.AddPoint(0, 0);
            tenauto2.AddPoint(0.25f, 0);
            tenauto2.AddPoint(0.5f, 1);

            var tenauto3			= new Automation();
            tenauto3.targetParam	= Automation.TargetParam.Volume;
            tenauto3.AddPoint(0, 0);
            tenauto3.AddPoint(0.5f, 0);
            tenauto3.AddPoint(1f, 1);

            return new Automation[] { tenauto1, tenauto2, tenauto3 };
        }