Beispiel #1
0
    void Update()
    {
        m_fTimeScale = Time.timeScale;

        // Recreate
        if (FXMakerMain.inst.GetInstanceEffectObject() == null && IsAutoRepeat() == false)
        {
            DelayCreateInstanceEffect(false);
        }
        else
        {
            // mesh info
            NgObject.GetMeshInfo(NcEffectBehaviour.GetRootInstanceEffect(), true, out m_nVertices, out m_nTriangles, out m_nMeshCount);

            // particle count
            m_nParticleCount = 0;
            ParticleSystem[] psComs = NcEffectBehaviour.GetRootInstanceEffect().GetComponentsInChildren <ParticleSystem>();
            foreach (ParticleSystem com in psComs)
            {
                m_nParticleCount += com.particleCount;
            }
            ParticleEmitter[] peComs = NcEffectBehaviour.GetRootInstanceEffect().GetComponentsInChildren <ParticleEmitter>();
            foreach (ParticleEmitter com in peComs)
            {
                m_nParticleCount += com.particleCount;
            }

            if (m_fDelayCreateTime < Time.time - m_fPlayStartTime)
            {
                // repeat
                if (IsRepeat() && m_fCreateTime + GetRepeatTime() < Time.time)
                {
                    DelayCreateInstanceEffect(false);
                }

                // auto repeat
                if (m_nTransIndex == 0 && IsAutoRepeat() && m_bCalledDelayCreate == false)                      // m_bStartAliveAnimation
                {
                    if (IsAliveAnimation() == false)
                    {
                        DelayCreateInstanceEffect(false);
                    }
                }

                NcController controller = GetNcController();
                if (controller != null &&
                    controller.ReachedLastFrameForEditor((int)((Time.time - m_fPlayStartTime) / NcFrameHelper.FixedSecondPerFrame)))
                {
                    m_fDelayCreateTime = 0;
                    DelayCreateInstanceEffect(false);
                }
            }
        }
    }
    string GetMeshInfo(Mesh mesh)
    {
        if (m_bSelectMeshDialog)
        {
            int     nVertices;
            int     nTriangles;
            int     nMeshCount;
            Vector3 size = mesh.bounds.extents * 2;

            NgObject.GetMeshInfo(mesh, out nVertices, out nTriangles, out nMeshCount);
            return(string.Format("- {0}\n- MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}\n- size: {4},{5},{6}", "Current Mesh", nMeshCount, nTriangles, nVertices, size.x.ToString("0.0"), size.y.ToString("0.0"), size.z.ToString("0.0")));
        }
        return("");
    }
	string GetObjectInfo(GameObject currentObj, string subDir)
	{
		if (m_bSelectMeshDialog)
		{
			int			nVertices;
			int			nTriangles;
			int			nMeshCount;
			MeshFilter	meshFilter	= currentObj.GetComponent<MeshFilter>();
			Vector3		size		= meshFilter.sharedMesh.bounds.extents * 2;

			NgObject.GetMeshInfo(currentObj, false, out nVertices, out nTriangles, out nMeshCount);
			return string.Format("- {0}\n- MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}\n- size: {4},{5},{6}", subDir, nMeshCount, nTriangles, nVertices, size.x.ToString("0.0"), size.y.ToString("0.0"), size.z.ToString("0.0"));
		} else {
			return currentObj.name + "\n" + subDir;
		}
	}
Beispiel #4
0
    void Update()
    {
        m_fTimeScale = Time.timeScale;

        if (FxmTestMain.inst.GetInstanceEffectObject() == null && IsAutoRepeat() == false)
        {
            DelayCreateInstanceEffect(false);
        }
        else
        {
            // mesh info
            NgObject.GetMeshInfo(NcEffectBehaviour.GetRootInstanceEffect(), true, out m_nVertices, out m_nTriangles, out m_nMeshCount);

            // particle count
            m_nParticleCount = 0;
            ParticleSystem[] psComs = NcEffectBehaviour.GetRootInstanceEffect().GetComponentsInChildren <ParticleSystem>();
            foreach (ParticleSystem com in psComs)
            {
                m_nParticleCount += com.particleCount;
            }
            ParticleEmitter[] peComs = NcEffectBehaviour.GetRootInstanceEffect().GetComponentsInChildren <ParticleEmitter>();
            foreach (ParticleEmitter com in peComs)
            {
                m_nParticleCount += com.particleCount;
            }

            if (m_fDelayCreateTime < Time.time - m_fPlayStartTime)
            {
                // repeat
                if (IsRepeat() && m_fCreateTime + GetRepeatTime() < Time.time)
                {
                    DelayCreateInstanceEffect(false);
                }

                // auto repeat
                if (m_nTransIndex == 0 && IsAutoRepeat() && m_bCalledDelayCreate == false)                      // m_bStartAliveAnimation
                {
                    if (IsAliveAnimation() == false)
                    {
                        DelayCreateInstanceEffect(false);
                    }
                }
            }
        }
    }
Beispiel #5
0
 private void Update()
 {
     this.m_fTimeScale = Time.timeScale;
     if (FxmTestMain.inst.GetInstanceEffectObject() == null && !this.IsAutoRepeat())
     {
         this.DelayCreateInstanceEffect(false);
     }
     else
     {
         NgObject.GetMeshInfo(NcEffectBehaviour.GetRootInstanceEffect(), true, out this.m_nVertices, out this.m_nTriangles, out this.m_nMeshCount);
         this.m_nParticleCount = 0;
         ParticleSystem[] componentsInChildren = NcEffectBehaviour.GetRootInstanceEffect().GetComponentsInChildren <ParticleSystem>();
         ParticleSystem[] array = componentsInChildren;
         for (int i = 0; i < array.Length; i++)
         {
             ParticleSystem particleSystem = array[i];
             this.m_nParticleCount += particleSystem.particleCount;
         }
         ParticleEmitter[] componentsInChildren2 = NcEffectBehaviour.GetRootInstanceEffect().GetComponentsInChildren <ParticleEmitter>();
         ParticleEmitter[] array2 = componentsInChildren2;
         for (int j = 0; j < array2.Length; j++)
         {
             ParticleEmitter particleEmitter = array2[j];
             this.m_nParticleCount += particleEmitter.particleCount;
         }
         if (this.m_fDelayCreateTime < Time.time - this.m_fPlayStartTime)
         {
             if (this.IsRepeat() && this.m_fCreateTime + this.GetRepeatTime() < Time.time)
             {
                 this.DelayCreateInstanceEffect(false);
             }
             if (this.m_nTransIndex == 0 && this.IsAutoRepeat() && !this.m_bCalledDelayCreate && !this.IsAliveAnimation())
             {
                 this.DelayCreateInstanceEffect(false);
             }
         }
     }
 }