public override void LoadContent()
        {
            scene       = Scene.Current();
            modelEffect = new ModelEffect {
                IsShadow = true
            };

            depthStencilState = new DepthStencilState()
            {
                DepthBufferEnable                      = true,
                DepthBufferWriteEnable                 = false,
                DepthBufferFunction                    = CompareFunction.LessEqual,
                StencilEnable                          = true,
                TwoSidedStencilMode                    = true,
                StencilFunction                        = CompareFunction.Always,
                ReferenceStencil                       = 0,
                StencilMask                            = 0xff,
                CounterClockwiseStencilFail            = StencilOperation.Keep,
                CounterClockwiseStencilDepthBufferFail = StencilOperation.Increment,
                CounterClockwiseStencilPass            = StencilOperation.Keep,
                StencilFail                            = StencilOperation.Keep,
                StencilDepthBufferFail                 = StencilOperation.Decrement,
                StencilPass                            = StencilOperation.Keep
            };
            rasterizerState = new RasterizerState {
                CullMode = CullMode.None
            };
        }
示例#2
0
        protected override string[] OnOnce(string srcFilePath)
        {
            GameObject srcPrefab = PrefabUtility.LoadPrefabContents(srcFilePath);
            GameObject newGo     = new GameObject();

            ModelEffect.Make(srcPrefab, newGo); //制作一个模型特效
            PrefabUtility.UnloadPrefabContents(srcPrefab);


            //计算特效时长
            {
                EffectLengthMono lenCom = newGo.GetComponent <EffectLengthMono>() ?? newGo.AddComponent <EffectLengthMono>();
                lenCom.Calculate();
            }


            //特效分级
            {
            }

            //保存
            string saveFolderPath = GetSaveFolderPath();
            string prefabKey      = XStringTools.SplitPathKey(srcFilePath);
            string savePath       = Path.Combine(saveFolderPath, string.Format("{0}.prefab", prefabKey));

            PrefabUtility.SaveAsPrefabAsset(newGo, savePath);
            Object.DestroyImmediate(newGo);

            return(new string[] { savePath });
        }
示例#3
0
 public override void LoadContent()
 {
     scene       = Scene.Current();
     modelEffect = new ModelEffect();
 }