Пример #1
0
        fPolylineGameObject allocate_polyline_go()
        {
            fPolylineGameObject go = GameObjectFactory.CreatePolylineGO(
                "gcode_path", new List <Vector3f>(), CCMaterials.PathMaterial_Default, true, 1.0f, LineWidthType.World);

            go.SetCornerQuality(fCurveGameObject.CornerQuality.Minimal);
            MaterialUtil.DisableShadows(go);
            return(go);
        }
Пример #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;
        }