示例#1
0
 void OnDestroy()
 {
     this.fvpr          = null;
     this.rendererComp  = null;
     this.propertyBlock = null;
     this.psRoot        = null;
     this.ps            = null;
     this.material      = null;
 }
 static public int get_Quat(IntPtr l)
 {
     try {
         LBoot.FVParticleRoot self = (LBoot.FVParticleRoot)checkSelf(l);
         pushValue(l, self.Quat);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_Rotation(IntPtr l)
 {
     try {
         LBoot.FVParticleRoot self = (LBoot.FVParticleRoot)checkSelf(l);
         UnityEngine.Vector3  v;
         checkType(l, 2, out v);
         self.Rotation = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_noFlip(IntPtr l)
 {
     try {
         LBoot.FVParticleRoot self = (LBoot.FVParticleRoot)checkSelf(l);
         System.Boolean       v;
         checkType(l, 2, out v);
         self.noFlip = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_ScaleRatio(IntPtr l)
 {
     try {
         LBoot.FVParticleRoot self = (LBoot.FVParticleRoot)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.ScaleRatio = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_Quat(IntPtr l)
 {
     try {
         LBoot.FVParticleRoot   self = (LBoot.FVParticleRoot)checkSelf(l);
         UnityEngine.Quaternion v;
         checkType(l, 2, out v);
         self.Quat = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#7
0
        public void Init(FVParticleRoot fvpRoot)
        {
//            if (additiveScalableShader == null)
//            {
//                additiveScalableShader = Shader.Find("Custom/Mobile/Particles/AdditiveScalable");
//            }
//
//            if (alphaScalableShader == null)
//            {
//                alphaScalableShader = Shader.Find("Custom/Mobile/Particles/AlphaScalable");
//            }

            fvpr = fvpRoot;

//            if (psRoot == null)
//            {
//                fvpr = GetComponentInParent<FVParticleRoot>();
//                if (fvpr != null)
//                    psRoot = fvpr.gameObject;
//            }
//            else
//            {
//                fvpr = psRoot.GetComponent<FVParticleRoot>();
//            }

            rendererComp = GetComponent <UnityEngine.Renderer>();

            if (material == null && rendererComp != null)
            {
// #if UNITY_EDITOR
//                 // avoid changing the original material in editor
//                 material = rendererComp.material;
// #else
                material = rendererComp.sharedMaterial;
// #endif
//                if (material != null && !material.shader.name.EndsWith("Scalable"))
//                {
//                    var shader = additiveScalableShader;
//                    if (material.shader.name.Contains("Alpha"))
//                    {
//                        shader = alphaScalableShader;
//                    }
//
//                    material.shader = shader;
//                }
            }

            ps = this.GetComponent <ParticleSystem>();
            if (ps != null)
            {
                isWorldSpace = (ps.simulationSpace == ParticleSystemSimulationSpace.World);
                saveOriginalParameter();
            }

            if (fvpr != null)
            {
                orgPositionOffset = this.transform.position - fvpr.transform.position;
                if (!isWorldSpace)
                {
                    propertyBlock = fvpr.PropertyBlock;
                }
                else
                {
                    if (staticPropertyBlockTexST == null)
                    {
                        staticPropertyBlockTexST = new MaterialPropertyBlock();
                    }
                    propertyBlock = staticPropertyBlockTexST;
                }
            }
            lastPosition = this.transform.position;
        }