Ejemplo n.º 1
0
        public static IShaderCommand Create(ShaderCommand type)
        {
            switch (type)
            {
            case ShaderCommand.RenderQueueTag: return(new RenderQueueTag());

            case ShaderCommand.IgnoreProjectorTag: return(new IgnoreProjectorTag());

            case ShaderCommand.RenderTypeTag: return(new RenderTypeTag());

            case ShaderCommand.Blend: return(new Blend());

            case ShaderCommand.BlendOperation: return(new BlendOperation());

            case ShaderCommand.ColorMask: return(new ColorMask());

            case ShaderCommand.Cull: return(new Cull());

            case ShaderCommand.ZClip: return(new ZClip());

            case ShaderCommand.ZTest: return(new ZTest());

            case ShaderCommand.ZWrite: return(new ZWrite());
            }

            return(default);
Ejemplo n.º 2
0
        internal void StartEventCoroutine(ShaderCommand shaderCommand, float startTime)
        {
            if (shaderCommand.Material == null)
            {
                Logger.log.Error("ShaderCommand with null material!");
                return;
            }

            shaderCommand.Properties.getProps().ForEach(sp => {
                float duration = sp.Duration;
                duration       = 60f * duration / _beatmapObjectSpawnController.currentBpm;

                if (!shaderCommand.Material.HasProperty(sp.Property))
                {
                    Logger.log.Error("ShaderCommand \"" + shaderCommand.ID + "\" wants to set a nonexistant property \"" + sp.Property + "\" for material \"" + shaderCommand.ReferenceName + "\"!");
                    return;
                }

                sp.Coroutine = SharedCoroutineStarter.instance.StartCoroutine(ShaderEventCoroutine(sp, startTime, duration, sp.Easing));
            });
        }