Exemple #1
0
        public static void InitializeMaterials()
        {
            PreviewTransparentMaterial = SOMaterial.CreateTransparent("preview_trans", new Colorf(Colorf.SelectionGold, 0.2f));

            PathMaterial_Extrude     = MaterialUtil.CreateFlatMaterial(Colorf.VideoBlack);
            PathMaterial_Support     = MaterialUtil.CreateFlatMaterial(Colorf.VideoMagenta);
            PathMaterial_Travel      = MaterialUtil.CreateFlatMaterial(Colorf.VideoGreen, 0.5f);
            PathMaterial_PlaneChange = MaterialUtil.CreateFlatMaterial(Colorf.VideoBlue, 0.5f);
            PathMaterial_Default     = MaterialUtil.CreateFlatMaterial(Colorf.VideoRed, 0.5f);
        }
Exemple #2
0
        //GameObject trailGO;
        //TrailRenderer trailRen;

        public PrintTempParticleSystem(GameObject parentGO)
        {
            heatParticlesGO = new GameObject("heatParticleSystem");
            ps = heatParticlesGO.AddComponent <ParticleSystem>();
            parentGO.AddChild(heatParticlesGO, false);

            Material heatMat = MaterialUtil.SafeLoadMaterial("HeatParticleMaterial");

            heatParticlesGO.GetComponent <ParticleSystemRenderer>().material =
                heatMat;
            //MaterialUtil.SafeLoadMaterial("Particles/Alpha Blended Premultiply");
            heatParticlesGO.SetLayer(FPlatform.WidgetOverlayLayer);
            heatParticlesGO.GetComponent <Renderer>().material.renderQueue = 4000;
            MaterialUtil.DisableShadows(heatParticlesGO);

            ps.Stop();


            sparksGO = UnityUtil.FindGameObjectByName("SparksPS");
            sparksGO.SetVisible(true);
            sparksPS = sparksGO.GetComponent <ParticleSystem>();
            sparksPS.Stop();
            parentGO.AddChild(sparksGO, false);


            fMaterial mat = MaterialUtil.CreateFlatMaterial(Colorf.VideoRed, 0.75f);

            trailGO = GameObjectFactory.CreatePolylineGO("trail", new List <Vector3f>(), mat, true, 0.5f, LineWidthType.World);
            trailGO.GetComponent <Renderer>().material.renderQueue = 3500;
            trailGO.SetCornerQuality(fCurveGameObject.CornerQuality.Minimal);
            trailGO.SetParent(parentGO);
            trailGO.SetLayer(FPlatform.WidgetOverlayLayer);
            MaterialUtil.DisableShadows(trailGO);

            //trailGO = new GameObject("heatTrail");
            //trailRen = trailGO.AddComponent<TrailRenderer>();
            //parentGO.AddChild(trailGO, false);

            //trailRen.material = MaterialUtil.CreateFlatMaterial(Colorf.VideoRed);
            //trailRen.material.renderQueue = 3500;
            //trailRen.minVertexDistance = 0.2f;
            //trailRen.numCornerVertices = 4;
            //trailRen.startWidth = 0.5f;
            //trailRen.endWidth = 0.1f;

            //trailRen.time = 2.0f;
        }