示例#1
0
    // -------------------------------------------------------------------------------------------
    void winActionToolbar(int id)
    {
        Rect       popupRect = GetActionToolbarRect();
        Rect       baseRect;
        Rect       rect;
        string     info        = "";
        string     infotooltip = "";
        int        nColCount   = 10;
        int        nRowCount   = 5;
        GUIContent content;

        // mini ----------------------------------------------------------------
        m_bMinimize = GUI.Toggle(new Rect(3, 1, FXMakerLayout.m_fMinimizeClickWidth, FXMakerLayout.m_fMinimizeClickHeight), m_bMinimize, "Mini");
        if (GUI.changed)
        {
            PlayerPrefs.SetInt("FxmTestControls.m_bMinimize", m_bMinimize ? 1 : 0);
        }
        GUI.changed = false;
        if (FXMakerLayout.m_bMinimizeAll || m_bMinimize)
        {
            nRowCount = 1;
            // mesh info -----------------------------------------------------------------
            baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
            if (FxmTestMain.inst.IsCurrentEffectObject())
            {
                info        = string.Format("P={0} M={1} T={2}", m_nParticleCount, m_nMeshCount, m_nTriangles);
                infotooltip = string.Format("ParticleCount = {0} MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}", m_nParticleCount, m_nMeshCount, m_nTriangles, m_nVertices);
            }
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), info);

            // CurrentTime Horizontal Slider ----------------------------------------------
            if (FxmTestMain.inst.IsCurrentEffectObject())
            {
                float fMaxTime = (m_nRepeatIndex <= m_nPlayIndex) ? m_fPlayToolbarTimes[m_nPlayIndex] : 10.0f;
                baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
                GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 2), "ElapsedTime " + (Time.time - m_fPlayStartTime).ToString("0.000"));
                rect    = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 4, 4);
                rect.y += 5;
                GUI.HorizontalSlider(rect, Time.time - m_fPlayStartTime, 0.0f, fMaxTime);

                // restart
                baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 8, 2), "Restart"))
                {
                    CreateInstanceEffect();
                }
            }

            return;
        }

        // mesh info -----------------------------------------------------------------
        baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 2);
        if (NcEffectBehaviour.GetRootInstanceEffect())
        {
            info        = string.Format("P = {0}\nM = {1}\nT = {2}", m_nParticleCount, m_nMeshCount, m_nTriangles);
            infotooltip = string.Format("ParticleCount = {0} MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}", m_nParticleCount, m_nMeshCount, m_nTriangles, m_nVertices);
        }
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 1), new GUIContent(info, NgTooltipTooltip(infotooltip)));

        // control button ------------------------------------------------------------
        if (FxmTestMain.inst.IsCurrentEffectObject())
        {
            bool bClick = false;

            // Play ---------------------------------------
            GUIContent[] playToolbarContents = GetHcEffectControls_Play(0, m_fTimeScale, m_fPlayToolbarTimes[1], m_fPlayToolbarTimes[m_nRepeatIndex], m_fPlayToolbarTimes[m_nRepeatIndex + 1], m_fPlayToolbarTimes[m_nRepeatIndex + 2], m_fPlayToolbarTimes[m_nRepeatIndex + 3], m_fPlayToolbarTimes[m_nRepeatIndex + 4]);
            baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 1, 1), new GUIContent("Play", ""));
            int nPlayIndex = GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 8), m_nPlayIndex, playToolbarContents, playToolbarContents.Length);

            if (GUI.changed)
            {
                bClick = true;
            }

            // Trans ---------------------------------------
            GUIContent[] TransToolbarContents = GetHcEffectControls_Trans(m_nTransAxis);
            baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 1, 1);
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 1, 1), new GUIContent("Trans", ""));
            int nTransIndex = GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 8), m_nTransIndex, TransToolbarContents, TransToolbarContents.Length);

            if (GUI.changed)
            {
                bClick = true;
                if ((nTransIndex == 1 || nTransIndex == 2) && Input.GetMouseButtonUp(1))                        // m_nTransIndex scale
                {
                    if (m_nTransAxis == AXIS.Z)
                    {
                        m_nTransAxis = 0;
                    }
                    else
                    {
                        m_nTransAxis++;
                    }
                    PlayerPrefs.SetInt("FxmTestControls.m_nTransAxis", (int)m_nTransAxis);
                }
            }

            if (bClick)
            {
                FxmTestMain.inst.CreateCurrentInstanceEffect(false);
                RunActionControl(nPlayIndex, nTransIndex);
                PlayerPrefs.SetInt("FxmTestControls.m_nPlayIndex", m_nPlayIndex);
                PlayerPrefs.SetInt("FxmTestControls.m_nTransIndex", m_nTransIndex);
            }
        }

        // TransSpeed Horizontal Slider -----------------------------------------------
        float TransSpeed = m_fDistPerTime;

        baseRect      = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 2, 1);
        content       = new GUIContent("DistPerTime", "");
        content.text += " " + m_fDistPerTime.ToString("00.00");
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), content);
        rect       = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 5);
        rect.y    += 5;
        TransSpeed = GUI.HorizontalSlider(rect, TransSpeed, 0.1f, 40.0f);
        // TransSpeed Trans ----------------------------------------------
//      if (GUI.Button(NgLayout.GetInnerHorizontalRect(baseRect, nColCount*2, 23, 1), new GUIContent("1", "")))
//          TransSpeed = 1;
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 14, 1), new GUIContent("<", "")))
        {
            TransSpeed = (int)(TransSpeed - 1);
        }
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 15, 1), new GUIContent(">", "")))
        {
            TransSpeed = (int)(TransSpeed + 1);
        }
        if (TransSpeed != m_fDistPerTime)
        {
            m_fDistPerTime = (TransSpeed == 0 ? 0.1f : TransSpeed);
            PlayerPrefs.SetFloat("FxmTestControls.m_fDistPerTime", m_fDistPerTime);
            // Trans 상태면.. 바로 적용
            if (0 < m_nTransIndex)
            {
                CreateInstanceEffect();
            }
        }

        if (NgLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 9, 1), new GUIContent("Multi", m_nMultiShotCount.ToString()), true))
        {
            if (Input.GetMouseButtonUp(0))
            {
                m_nMultiShotCount++;
                if (4 < m_nMultiShotCount)
                {
                    m_nMultiShotCount = 1;
                }
            }
            else
            {
                m_nMultiShotCount = 1;
            }
            CreateInstanceEffect();
        }

        // front Rotation ----------------------------------------------
        GUIContent[] rotateToolbarContents = GetHcEffectControls_Rotate();
        baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 2, 1);
        int nRotateIndex = GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 8, 1), m_nRotateIndex, rotateToolbarContents, rotateToolbarContents.Length);

        if (nRotateIndex != m_nRotateIndex)
        {
            m_nRotateIndex = nRotateIndex;
            PlayerPrefs.SetInt("FxmTestControls.m_nRotateIndex", m_nRotateIndex);
            // Trans 상태면.. 바로 적용
            if (0 < m_nTransIndex)
            {
                CreateInstanceEffect();
            }
        }

        // timeScale Horizontal Slider -----------------------------------------------
        float timeScale = m_fTimeScale;

        baseRect      = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 3, 1);
        content       = new GUIContent("TimeScale", "");
        content.text += " " + m_fTimeScale.ToString("0.00");
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), content);
        rect      = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 5);
        rect.y   += 5;
        timeScale = GUI.HorizontalSlider(rect, timeScale, 0.0f, 3.0f);
        if (timeScale == 0)
        {
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 7, 1), new GUIContent("Resume", "")))
            {
                timeScale = m_fOldTimeScale;
            }
        }
        else
        {
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 7, 1), new GUIContent("Pause", "")))
            {
                timeScale = 0;
            }
        }
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 8, 1), new GUIContent("Reset", "")))
        {
            timeScale = 1;
        }
        SetTimeScale(timeScale);

        // CurrentTime Horizontal Slider ----------------------------------------------
        if (FxmTestMain.inst.IsCurrentEffectObject())
        {
            float fMaxTime = (m_nRepeatIndex <= m_nPlayIndex) ? m_fPlayToolbarTimes[m_nPlayIndex] : 10.0f;
            baseRect      = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 4, 1);
            content       = new GUIContent("ElapsedTime", "");
            content.text += " " + (Time.time - m_fPlayStartTime).ToString("0.000");
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), content);
            rect    = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 5);
            rect.y += 5;
            GUI.HorizontalSlider(rect, Time.time - m_fPlayStartTime, 0.0f, fMaxTime);
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 14, 1), new GUIContent("+.5", "")))
            {
                SetTimeScale(1.0f);
                Invoke("invokeStopTimer", 0.5f);
            }
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 15, 1), new GUIContent("+.1", "")))
            {
                SetTimeScale(0.4f);
                Invoke("invokeStopTimer", 0.1f);
            }
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 16, 1), new GUIContent("+.05", "")))
            {
                SetTimeScale(0.2f);
                Invoke("invokeStopTimer", 0.05f);
            }
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 17, 1), new GUIContent("+.01", "")))
            {
                SetTimeScale(0.04f);
                Invoke("invokeStopTimer", 0.01f);
            }

            // restart
            baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 3, 2);
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 9, 1), new GUIContent("Restart", "")))
            {
                CreateInstanceEffect();
            }
        }
    }
 private void Update()
 {
     if (!this.m_bStartDetach)
     {
         this.m_bStartDetach = true;
         if (base.transform.parent != null)
         {
             this.m_ParentGameObject = base.transform.parent.gameObject;
             this.m_ncDetachObject   = NcDetachObject.Create(this.m_ParentGameObject, base.transform.gameObject);
         }
         GameObject rootInstanceEffect = NcEffectBehaviour.GetRootInstanceEffect();
         if (this.m_bFollowParentTransform)
         {
             this.m_OriginalPos.SetLocalTransform(base.transform);
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
             this.m_OriginalPos.CopyToLocalTransform(base.transform);
         }
         else
         {
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
         }
         if (!this.m_bParentHideToStartDestroy)
         {
             this.StartDestroy();
         }
     }
     if (0f < this.m_fStartDestroyTime)
     {
         if (0f < this.m_fSmoothDestroyTime)
         {
             if (this.m_bSmoothHide)
             {
                 float num = 1f - (NcEffectBehaviour.GetEngineTime() - this.m_fStartDestroyTime) / this.m_fSmoothDestroyTime;
                 if (num < 0f)
                 {
                     num = 0f;
                 }
                 if (this.m_bMeshFilterOnlySmoothHide)
                 {
                     MeshFilter[] componentsInChildren = base.transform.GetComponentsInChildren <MeshFilter>(true);
                     for (int i = 0; i < componentsInChildren.Length; i++)
                     {
                         Color[] array = componentsInChildren[i].mesh.colors;
                         if (array.Length == 0)
                         {
                             array = new Color[componentsInChildren[i].mesh.vertices.Length];
                             for (int j = 0; j < array.Length; j++)
                             {
                                 array[j] = Color.white;
                             }
                         }
                         for (int k = 0; k < array.Length; k++)
                         {
                             Color color = array[k];
                             color.a  = Mathf.Min(color.a, num);
                             array[k] = color;
                         }
                         componentsInChildren[i].mesh.colors = array;
                     }
                 }
                 else
                 {
                     Renderer[] componentsInChildren2 = base.transform.GetComponentsInChildren <Renderer>(true);
                     for (int l = 0; l < componentsInChildren2.Length; l++)
                     {
                         Renderer renderer          = componentsInChildren2[l];
                         string   materialColorName = NcEffectBehaviour.GetMaterialColorName(renderer.sharedMaterial);
                         if (materialColorName != null)
                         {
                             Color color2 = renderer.material.GetColor(materialColorName);
                             color2.a = Mathf.Min(color2.a, num);
                             renderer.material.SetColor(materialColorName, color2);
                         }
                     }
                 }
             }
             if (this.m_fStartDestroyTime + this.m_fSmoothDestroyTime < NcEffectBehaviour.GetEngineTime())
             {
                 UnityEngine.Object.Destroy(base.gameObject);
             }
         }
     }
     else if (this.m_bParentHideToStartDestroy && (this.m_ParentGameObject == null || !NcEffectBehaviour.IsActive(this.m_ParentGameObject)))
     {
         this.StartDestroy();
     }
     if (this.m_bFollowParentTransform && this.m_ParentGameObject != null && this.m_ParentGameObject.transform != null)
     {
         NcTransformTool ncTransformTool = new NcTransformTool();
         ncTransformTool.SetTransform(this.m_OriginalPos);
         ncTransformTool.AddTransform(this.m_ParentGameObject.transform);
         ncTransformTool.CopyToLocalTransform(base.transform);
     }
 }
示例#3
0
 public GameObject GetInstanceRoot()
 {
     return(NcEffectBehaviour.GetRootInstanceEffect());
 }
示例#4
0
    bool IsAliveAnimation()
    {
        GameObject rootInstObj = NcEffectBehaviour.GetRootInstanceEffect();

        Transform[] tranComs = rootInstObj.GetComponentsInChildren <Transform>(true);
        foreach (Transform trans in tranComs)
        {
            int  bNcAni    = -1;                                        // -1:None, 0:End, 1:Alive
            int  bParticle = -1;
            bool bRen      = false;

            // Check Animation
            NcEffectBehaviour[] effList = trans.GetComponents <NcEffectBehaviour>();
            foreach (NcEffectBehaviour eff in effList)
            {
                switch (eff.GetAnimationState())
                {
                case 1: bNcAni = 1;    break;

                case 0: bNcAni = 0;    break;
                }
            }

            // Check ParticleSystem
            if (trans.particleSystem != null)
            {
                bParticle = 0;
                if (NgObject.IsActive(trans.gameObject) && ((trans.particleSystem.enableEmission && trans.particleSystem.IsAlive()) || 0 < trans.particleSystem.particleCount))
                {
                    bParticle = 1;
                }
            }

            // Check ParticleSystem
            if (bParticle < 1)
            {
                if (trans.particleEmitter != null)
                {
                    bParticle = 0;
                    if (NgObject.IsActive(trans.gameObject) && (trans.particleEmitter.emit || 0 < trans.particleEmitter.particleCount))
                    {
                        bParticle = 1;
                    }
                }
            }

            // Check Renderer
            if (trans.renderer != null)
            {
                if (trans.renderer.enabled && NgObject.IsActive(trans.gameObject))
                {
                    bRen = true;
                }
            }

//              Debug.Log("bNcAni " + bNcAni + ", bParticle " + bParticle + ", bRen " + bRen);
            if (0 < bNcAni)
            {
                return(true);
            }
            if (bParticle == 1)
            {
                return(true);
            }
            if (bRen && (trans.GetComponent <MeshFilter>() != null || trans.GetComponent <TrailRenderer>() != null || trans.GetComponent <LineRenderer>() != null))
            {
                return(true);
            }
        }
        return(false);
    }
示例#5
0
 private void Update()
 {
     if (!this.m_bStartDetach)
     {
         this.m_bStartDetach = true;
         if (base.transform.parent != null)
         {
             this.m_ParentGameObject = base.transform.parent.gameObject;
             NcDetachObject.Create(this.m_ParentGameObject, base.transform.gameObject);
         }
         GameObject rootInstanceEffect = NcEffectBehaviour.GetRootInstanceEffect();
         if (this.m_bFollowParentTransform)
         {
             this.m_OriginalPos.SetLocalTransform(base.transform);
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
             this.m_OriginalPos.CopyToLocalTransform(base.transform);
         }
         else
         {
             base.ChangeParent(rootInstanceEffect.transform, base.transform, false, null);
         }
         if (!this.m_bParentHideToStartDestroy)
         {
             this.StartDestroy();
         }
     }
     if (0f < this.m_fStartDestroyTime)
     {
         if (0f < this.m_fSmoothDestroyTime)
         {
             if (this.m_bSmoothHide)
             {
                 float num = 1f - (NcEffectBehaviour.GetEngineTime() - this.m_fStartDestroyTime) / this.m_fSmoothDestroyTime;
                 if (num < 0f)
                 {
                     num = 0f;
                 }
                 Renderer[] componentsInChildren = base.transform.GetComponentsInChildren <Renderer>(true);
                 for (int i = 0; i < componentsInChildren.Length; i++)
                 {
                     Renderer renderer          = componentsInChildren[i];
                     string   materialColorName = NcEffectBehaviour.GetMaterialColorName(renderer.material);
                     if (materialColorName != null)
                     {
                         Color color = renderer.material.GetColor(materialColorName);
                         color.a = Mathf.Min(num, color.a);
                         renderer.material.SetColor(materialColorName, color);
                     }
                 }
             }
             if (this.m_fStartDestroyTime + this.m_fSmoothDestroyTime < NcEffectBehaviour.GetEngineTime())
             {
                 DelegateProxy.GameDestory(base.gameObject);
             }
         }
     }
     else if (this.m_bParentHideToStartDestroy && (this.m_ParentGameObject == null || !NcEffectBehaviour.IsActive(this.m_ParentGameObject)))
     {
         this.StartDestroy();
     }
     if (this.m_bFollowParentTransform && this.m_ParentGameObject != null && this.m_ParentGameObject.transform != null)
     {
         NcTransformTool ncTransformTool = new NcTransformTool();
         ncTransformTool.SetTransform(this.m_OriginalPos);
         ncTransformTool.AddTransform(this.m_ParentGameObject.transform);
         ncTransformTool.CopyToLocalTransform(base.transform);
     }
 }
示例#6
0
    // -------------------------------------------------------------------------------------------
    void winActionToolbar(int id)
    {
        Rect       popupRect = FXMakerLayout.GetActionToolbarRect();
        Rect       baseRect;
        Rect       rect;
        string     info        = "";
        string     infotooltip = "";
        int        nColCount   = 10;
        int        nRowCount   = 6;
        GUIContent content;

        // window desc -----------------------------------------------------------
        FXMakerTooltip.WindowDescription(popupRect, FXMakerLayout.WINDOWID.EFFECT_CONTROLS, null);

        // mini ----------------------------------------------------------------
        m_bMinimize = GUI.Toggle(new Rect(3, 1, FXMakerLayout.m_fMinimizeClickWidth, FXMakerLayout.m_fMinimizeClickHeight), m_bMinimize, "Mini");
        if (GUI.changed)
        {
            EditorPrefs.SetBool("FXMakerControls.m_bMinimize", m_bMinimize);
        }
        GUI.changed = false;
        if (FXMakerLayout.m_bMinimizeAll || m_bMinimize)
        {
            FXMakerLayout.m_fActionToolbarHeight = FXMakerLayout.m_MinimizeHeight;

            nRowCount = 1;
            // mesh info -----------------------------------------------------------------
            baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
            if (FXMakerMain.inst.IsCurrentEffectObject())
            {
                info        = string.Format("P={0} M={1} T={2}", m_nParticleCount, m_nMeshCount, m_nTriangles);
                infotooltip = string.Format("ParticleCount = {0} MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}", m_nParticleCount, m_nMeshCount, m_nTriangles, m_nVertices);
            }
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), new GUIContent(info, FXMakerTooltip.Tooltip(infotooltip)));

            // CurrentTime Horizontal Slider ----------------------------------------------
            if (FXMakerMain.inst.IsCurrentEffectObject())
            {
                float fMaxTime = (m_nRepeatIndex <= m_nPlayIndex) ? m_fPlayToolbarTimes[m_nPlayIndex] : 10.0f;
                baseRect      = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
                content       = FXMakerTooltip.GetHcEffectControls("ElapsedTime", "");
                content.text += " " + (Time.time - m_fPlayStartTime).ToString("0.000");
                GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 2), content);
                rect    = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 4, 4);
                rect.y += 5;
                GUI.HorizontalSlider(rect, Time.time - m_fPlayStartTime, 0.0f, fMaxTime);

                // restart
                baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 8, 2), FXMakerTooltip.GetHcEffectControls("Restart", "")))
                {
                    CreateInstanceEffect();
                }
            }

            FXMakerMain.inst.SaveTooltip();
            return;
        }
        else
        {
            FXMakerLayout.m_fActionToolbarHeight = FXMakerLayout.m_fOriActionToolbarHeight;
        }

        // mesh info -----------------------------------------------------------------
        baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 2);
        if (NcEffectBehaviour.GetRootInstanceEffect())
        {
            info        = string.Format("P = {0}\nM = {1}\nT = {2}", m_nParticleCount, m_nMeshCount, m_nTriangles);
            infotooltip = string.Format("ParticleCount = {0} MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}", m_nParticleCount, m_nMeshCount, m_nTriangles, m_nVertices);
        }
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 1), new GUIContent(info, FXMakerTooltip.Tooltip(infotooltip)));

        // control button ------------------------------------------------------------
        if (FXMakerMain.inst.IsCurrentEffectObject())
        {
            bool bClick = false;

            // Play ---------------------------------------
            GUIContent[] playToolbarContents = FXMakerTooltip.GetHcEffectControls_Play(0, m_fTimeScale, m_fPlayToolbarTimes[1], m_fPlayToolbarTimes[m_nRepeatIndex], m_fPlayToolbarTimes[m_nRepeatIndex + 1], m_fPlayToolbarTimes[m_nRepeatIndex + 2], m_fPlayToolbarTimes[m_nRepeatIndex + 3], m_fPlayToolbarTimes[m_nRepeatIndex + 4]);
            baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 0, 1);
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 1, 1), FXMakerTooltip.GetHcEffectControls("Play", ""));
//			int nPlayIndex	= GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 8), m_nPlayIndex, playToolbarContents, playToolbarContents.Length);
            int nPlayIndex = FXMakerLayout.TooltipSelectionGrid(popupRect, FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 8), m_nPlayIndex, playToolbarContents, playToolbarContents.Length);

            if (GUI.changed)
            {
                bClick = true;
            }

            // Trans ---------------------------------------
            GUIContent[] TransToolbarContents = FXMakerTooltip.GetHcEffectControls_Trans(m_nTransAxis);
            baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 1, 1);
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 1, 1), FXMakerTooltip.GetHcEffectControls("Trans", ""));
//			int nTransIndex	= GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 8), m_nTransIndex, TransToolbarContents, TransToolbarContents.Length);
            int nTransIndex = FXMakerLayout.TooltipSelectionGrid(popupRect, FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 8), m_nTransIndex, TransToolbarContents, TransToolbarContents.Length);

            if (GUI.changed)
            {
                bClick       = true;
                m_fTransRate = 1.0f;
                if ((nTransIndex == 1 || nTransIndex == 2) && Input.GetMouseButtonUp(1))                        // m_nTransIndex scale
                {
                    if (m_nTransAxis == NgEnum.AXIS.Z)
                    {
                        m_nTransAxis = 0;
                    }
                    else
                    {
                        m_nTransAxis++;
                    }
                    UnityEditor.EditorPrefs.SetInt("FXMakerControls.m_nTransAxis", (int)m_nTransAxis);
                }
            }

            if (bClick)
            {
                FXMakerMain.inst.CreateCurrentInstanceEffect(false);
                RunActionControl(nPlayIndex, nTransIndex);
                UnityEditor.EditorPrefs.SetInt("FXMakerControls.m_nPlayIndex", m_nPlayIndex);
                UnityEditor.EditorPrefs.SetInt("FXMakerControls.m_nTransIndex", m_nTransIndex);
            }
        }

        // TransSpeed Horizontal Slider -----------------------------------------------
        float TransSpeed = m_fDistPerTime;

        baseRect      = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 2, 1);
        content       = FXMakerTooltip.GetHcEffectControls("DistPerTime", "");
        content.text += " " + m_fDistPerTime.ToString("00.00");
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), content);
        rect       = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 5);
        rect.y    += 5;
        TransSpeed = GUI.HorizontalSlider(rect, TransSpeed, 0.1f, 40.0f);
        // TransSpeed Trans ----------------------------------------------
//      if (GUI.Button(NgLayout.GetInnerHorizontalRect(baseRect, nColCount*2, 23, 1), NgTooltip.GetHcEffectControls("1", "")))
//          TransSpeed = 1;
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 14, 1), FXMakerTooltip.GetHcEffectControls("<", "")))
        {
            TransSpeed = (int)(TransSpeed - 1);
        }
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 15, 1), FXMakerTooltip.GetHcEffectControls(">", "")))
        {
            TransSpeed = (int)(TransSpeed + 1);
        }
        if (TransSpeed != m_fDistPerTime)
        {
            m_fDistPerTime = (TransSpeed == 0 ? 0.1f : TransSpeed);
            UnityEditor.EditorPrefs.SetFloat("FXMakerControls.m_fDistPerTime", m_fDistPerTime);
            // Trans サ?ナツク?. ケルキホ タ?ソ?
            if (0 < m_nTransIndex)
            {
                CreateInstanceEffect();
            }
        }

        if (NgLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 9, 1), FXMakerTooltip.GetHcEffectControls("Multi", m_nMultiShotCount.ToString()), true))
        {
            if (Input.GetMouseButtonUp(0))
            {
                m_nMultiShotCount++;
                if (4 < m_nMultiShotCount)
                {
                    m_nMultiShotCount = 1;
                }
            }
            else
            {
                m_nMultiShotCount = 1;
            }
            CreateInstanceEffect();
        }

        // front Rotation ----------------------------------------------
        GUIContent[] rotateToolbarContents = FXMakerTooltip.GetHcEffectControls_Rotate();
        baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 2, 1);
        int nRotateIndex = FXMakerLayout.TooltipSelectionGrid(popupRect, FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 8, 1), m_nRotateIndex, rotateToolbarContents, rotateToolbarContents.Length);

        if (nRotateIndex != m_nRotateIndex)
        {
            m_nRotateIndex = nRotateIndex;
            UnityEditor.EditorPrefs.SetInt("FXMakerControls.m_nRotateIndex", m_nRotateIndex);
            // Trans サ?ナツク?. ケルキホ タ?ソ?
            if (0 < m_nTransIndex)
            {
                CreateInstanceEffect();
            }
        }

        // timeScale Horizontal Slider -----------------------------------------------
        float timeScale = m_fTimeScale;

        baseRect      = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 3, 1);
        content       = FXMakerTooltip.GetHcEffectControls("TimeScale", "");
        content.text += " " + m_fTimeScale.ToString("0.00");
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), content);
        rect      = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 5);
        rect.y   += 5;
        timeScale = GUI.HorizontalSlider(rect, timeScale, 0.0f, 2.0f);
        if (timeScale == 0)
        {
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 7, 1), FXMakerTooltip.GetHcEffectControls("Resume", "")))
            {
                timeScale = m_fOldTimeScale;
            }
        }
        else
        {
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 7, 1), FXMakerTooltip.GetHcEffectControls("Pause", "")))
            {
                timeScale = 0;
            }
        }
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 8, 1), FXMakerTooltip.GetHcEffectControls("Reset", "")))
        {
            timeScale = 1;
        }
        SetTimeScale(timeScale);

        // CurrentTime Horizontal Slider ----------------------------------------------
        if (FXMakerMain.inst.IsCurrentEffectObject())
        {
            {
                float fMaxTime = (m_nRepeatIndex <= m_nPlayIndex) ? m_fPlayToolbarTimes[m_nPlayIndex] : 10.0f;
                baseRect      = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 4, 1);
                content       = FXMakerTooltip.GetHcEffectControls("ElapsedTime", "");
                content.text += " " + (Time.time - m_fPlayStartTime).ToString("0.000");
                GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), content);
                rect    = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 5);
                rect.y += 5;
                GUI.HorizontalSlider(rect, Time.time - m_fPlayStartTime, 0.0f, fMaxTime);
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 14, 1), FXMakerTooltip.GetHcEffectControls("+.5", "")))
                {
                    SetTimeScale(1.0f);
                    Invoke("invokeStopTimer", 0.5f);
                }
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 15, 1), FXMakerTooltip.GetHcEffectControls("+.1", "")))
                {
                    SetTimeScale(0.4f);
                    Invoke("invokeStopTimer", 0.1f);
                }
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 16, 1), FXMakerTooltip.GetHcEffectControls("+.05", "")))
                {
                    SetTimeScale(0.2f);
                    Invoke("invokeStopTimer", 0.05f);
                }
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 17, 1), FXMakerTooltip.GetHcEffectControls("+.01", "")))
                {
                    SetTimeScale(0.04f);
                    Invoke("invokeStopTimer", 0.01f);
                }

                // restart
                baseRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 3, 2);
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 9, 1), FXMakerTooltip.GetHcEffectControls("Restart", "")))
                {
                    CreateInstanceEffect();
                }
            }
            {
                float fixedSecondPerFrame = NcFrameHelper.FixedSecondPerFrame;
                //   float fixedSecondPerFrame = 1f/30f;
                float currentFrame = (Time.time - m_fPlayStartTime) / fixedSecondPerFrame;
                float fMaxTime     = (m_nRepeatIndex <= m_nPlayIndex) ? m_fPlayToolbarTimes[m_nPlayIndex] : 10.0f;
                float fMaxFrame    = fMaxTime / fixedSecondPerFrame;

                baseRect     = FXMakerLayout.GetChildVerticalRect(popupRect, 0, nRowCount, 5, 1);
                content      = FXMakerTooltip.GetHcEffectControls("Frame", "");
                content.text = "Frame " + currentFrame.ToString("0");
                GUI.Box(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 0, 2), content);
                rect    = FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount, 2, 5);
                rect.y += 5;
                GUI.HorizontalSlider(rect, currentFrame, 0.0f, fMaxFrame);
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 14, 1), FXMakerTooltip.GetHcEffectControls("-1", "")))
                {
                    if (currentFrame < 1)
                    {
                        return;
                    }
                    CreateInstanceEffect();
                    float skipSeconds = fixedSecondPerFrame * (currentFrame - 1);
                    SetTimeScale(1.0f);
                    Invoke("invokeStopTimer", skipSeconds);
                }
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(baseRect, nColCount * 2, 15, 1), FXMakerTooltip.GetHcEffectControls("+1", "")))
                {
                    SetTimeScale(fixedSecondPerFrame * 4f);
                    Invoke("invokeStopTimer", fixedSecondPerFrame);
                }
            }
        }
        FXMakerMain.inst.SaveTooltip();
    }
示例#7
0
    private void winActionToolbar(int id)
    {
        Rect   actionToolbarRect = this.GetActionToolbarRect();
        string text  = string.Empty;
        string str   = string.Empty;
        int    num   = 10;
        int    count = 5;

        this.m_bMinimize = GUI.Toggle(new Rect(3f, 1f, FXMakerLayout.m_fMinimizeClickWidth, FXMakerLayout.m_fMinimizeClickHeight), this.m_bMinimize, "Mini");
        if (GUI.changed)
        {
            PlayerPrefs.SetInt("FxmTestControls.m_bMinimize", (!this.m_bMinimize) ? 0 : 1);
        }
        GUI.changed = false;
        Rect childVerticalRect;
        Rect innerHorizontalRect;

        if (FXMakerLayout.m_bMinimizeAll || this.m_bMinimize)
        {
            count             = 1;
            childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 0, 1);
            if (FxmTestMain.inst.IsCurrentEffectObject())
            {
                text = string.Format("P={0} M={1} T={2}", this.m_nParticleCount, this.m_nMeshCount, this.m_nTriangles);
                str  = string.Format("ParticleCount = {0} MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}", new object[]
                {
                    this.m_nParticleCount,
                    this.m_nMeshCount,
                    this.m_nTriangles,
                    this.m_nVertices
                });
            }
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 0, 2), text);
            if (FxmTestMain.inst.IsCurrentEffectObject())
            {
                float rightValue = (3 > this.m_nPlayIndex) ? 10f : this.m_fPlayToolbarTimes[this.m_nPlayIndex];
                childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 0, 1);
                GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 2, 2), "ElapsedTime " + (Time.time - this.m_fPlayStartTime).ToString("0.000"));
                innerHorizontalRect    = FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 4, 4);
                innerHorizontalRect.y += 5f;
                GUI.HorizontalSlider(innerHorizontalRect, Time.time - this.m_fPlayStartTime, 0f, rightValue);
                childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 0, 1);
                if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 8, 2), "Restart"))
                {
                    this.CreateInstanceEffect();
                }
            }
            return;
        }
        childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 0, 2);
        if (NcEffectBehaviour.GetRootInstanceEffect())
        {
            text = string.Format("P = {0}\nM = {1}\nT = {2}", this.m_nParticleCount, this.m_nMeshCount, this.m_nTriangles);
            str  = string.Format("ParticleCount = {0} MeshCount = {1}\n Mesh: Triangles = {2} Vertices = {3}", new object[]
            {
                this.m_nParticleCount,
                this.m_nMeshCount,
                this.m_nTriangles,
                this.m_nVertices
            });
        }
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 0, 1), new GUIContent(text, this.NgTooltipTooltip(str)));
        if (FxmTestMain.inst.IsCurrentEffectObject())
        {
            bool         flag = false;
            GUIContent[] hcEffectControls_Play = FxmTestControls.GetHcEffectControls_Play(0f, this.m_fTimeScale, this.m_fPlayToolbarTimes[1], this.m_fPlayToolbarTimes[3], this.m_fPlayToolbarTimes[4], this.m_fPlayToolbarTimes[5], this.m_fPlayToolbarTimes[6], this.m_fPlayToolbarTimes[7]);
            childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 0, 1);
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 1, 1), new GUIContent("Play", string.Empty));
            int nPlayIndex = GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 2, 8), this.m_nPlayIndex, hcEffectControls_Play, hcEffectControls_Play.Length);
            if (GUI.changed)
            {
                flag = true;
            }
            GUIContent[] hcEffectControls_Trans = FxmTestControls.GetHcEffectControls_Trans(this.m_nTransAxis);
            childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 1, 1);
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 1, 1), new GUIContent("Trans", string.Empty));
            int num2 = GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 2, 8), this.m_nTransIndex, hcEffectControls_Trans, hcEffectControls_Trans.Length);
            if (GUI.changed)
            {
                flag = true;
                if ((num2 == 1 || num2 == 2) && Input.GetMouseButtonUp(1))
                {
                    if (this.m_nTransAxis == FxmTestControls.AXIS.Z)
                    {
                        this.m_nTransAxis = FxmTestControls.AXIS.X;
                    }
                    else
                    {
                        this.m_nTransAxis++;
                    }
                    PlayerPrefs.SetInt("FxmTestControls.m_nTransAxis", (int)this.m_nTransAxis);
                }
            }
            if (flag)
            {
                FxmTestMain.inst.CreateCurrentInstanceEffect(false);
                this.RunActionControl(nPlayIndex, num2);
                PlayerPrefs.SetInt("FxmTestControls.m_nPlayIndex", this.m_nPlayIndex);
                PlayerPrefs.SetInt("FxmTestControls.m_nTransIndex", this.m_nTransIndex);
            }
        }
        float num3 = this.m_fDistPerTime;

        childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 2, 1);
        GUIContent gUIContent = new GUIContent("DistPerTime", string.Empty);
        GUIContent expr_471   = gUIContent;

        expr_471.text = expr_471.text + " " + this.m_fDistPerTime.ToString("00.00");
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 0, 2), gUIContent);
        innerHorizontalRect    = FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 2, 5);
        innerHorizontalRect.y += 5f;
        num3 = GUI.HorizontalSlider(innerHorizontalRect, num3, 0.1f, 40f);
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num * 2, 14, 1), new GUIContent("<", string.Empty)))
        {
            num3 = (float)((int)(num3 - 1f));
        }
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num * 2, 15, 1), new GUIContent(">", string.Empty)))
        {
            num3 = (float)((int)(num3 + 1f));
        }
        if (num3 != this.m_fDistPerTime)
        {
            this.m_fDistPerTime = ((num3 != 0f) ? num3 : 0.1f);
            PlayerPrefs.SetFloat("FxmTestControls.m_fDistPerTime", this.m_fDistPerTime);
            if (0 < this.m_nTransIndex)
            {
                this.CreateInstanceEffect();
            }
        }
        if (NgLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 9, 1), new GUIContent("Multi", this.m_nMultiShotCount.ToString()), true))
        {
            if (Input.GetMouseButtonUp(0))
            {
                this.m_nMultiShotCount++;
                if (4 < this.m_nMultiShotCount)
                {
                    this.m_nMultiShotCount = 1;
                }
            }
            else
            {
                this.m_nMultiShotCount = 1;
            }
            this.CreateInstanceEffect();
        }
        GUIContent[] hcEffectControls_Rotate = FxmTestControls.GetHcEffectControls_Rotate();
        childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 2, 1);
        int num4 = GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 8, 1), this.m_nRotateIndex, hcEffectControls_Rotate, hcEffectControls_Rotate.Length);

        if (num4 != this.m_nRotateIndex)
        {
            this.m_nRotateIndex = num4;
            PlayerPrefs.SetInt("FxmTestControls.m_nRotateIndex", this.m_nRotateIndex);
            if (0 < this.m_nTransIndex)
            {
                this.CreateInstanceEffect();
            }
        }
        float num5 = this.m_fTimeScale;

        childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 3, 1);
        gUIContent        = new GUIContent("TimeScale", string.Empty);
        GUIContent expr_681 = gUIContent;

        expr_681.text = expr_681.text + " " + this.m_fTimeScale.ToString("0.00");
        GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 0, 2), gUIContent);
        innerHorizontalRect    = FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 2, 5);
        innerHorizontalRect.y += 5f;
        num5 = GUI.HorizontalSlider(innerHorizontalRect, num5, 0f, 3f);
        if (num5 == 0f)
        {
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 7, 1), new GUIContent("Resume", string.Empty)))
            {
                num5 = this.m_fOldTimeScale;
            }
        }
        else if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 7, 1), new GUIContent("Pause", string.Empty)))
        {
            num5 = 0f;
        }
        if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 8, 1), new GUIContent("Reset", string.Empty)))
        {
            num5 = 1f;
        }
        this.SetTimeScale(num5);
        if (FxmTestMain.inst.IsCurrentEffectObject())
        {
            float rightValue2 = (3 > this.m_nPlayIndex) ? 10f : this.m_fPlayToolbarTimes[this.m_nPlayIndex];
            childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 4, 1);
            gUIContent        = new GUIContent("ElapsedTime", string.Empty);
            GUIContent expr_7D4 = gUIContent;
            expr_7D4.text = expr_7D4.text + " " + (Time.time - this.m_fPlayStartTime).ToString("0.000");
            GUI.Box(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 0, 2), gUIContent);
            innerHorizontalRect    = FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 2, 5);
            innerHorizontalRect.y += 5f;
            GUI.HorizontalSlider(innerHorizontalRect, Time.time - this.m_fPlayStartTime, 0f, rightValue2);
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num * 2, 14, 1), new GUIContent("+.5", string.Empty)))
            {
                this.SetTimeScale(1f);
                base.Invoke("invokeStopTimer", 0.5f);
            }
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num * 2, 15, 1), new GUIContent("+.1", string.Empty)))
            {
                this.SetTimeScale(0.4f);
                base.Invoke("invokeStopTimer", 0.1f);
            }
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num * 2, 16, 1), new GUIContent("+.05", string.Empty)))
            {
                this.SetTimeScale(0.2f);
                base.Invoke("invokeStopTimer", 0.05f);
            }
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num * 2, 17, 1), new GUIContent("+.01", string.Empty)))
            {
                this.SetTimeScale(0.04f);
                base.Invoke("invokeStopTimer", 0.01f);
            }
            childVerticalRect = FXMakerLayout.GetChildVerticalRect(actionToolbarRect, 0, count, 3, 2);
            if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(childVerticalRect, num, 9, 1), new GUIContent("Restart", string.Empty)))
            {
                this.CreateInstanceEffect();
            }
        }
    }
示例#8
0
    private bool IsAliveAnimation()
    {
        GameObject rootInstanceEffect = NcEffectBehaviour.GetRootInstanceEffect();

        Transform[] componentsInChildren = rootInstanceEffect.GetComponentsInChildren <Transform>(true);
        Transform[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            Transform           transform  = array[i];
            int                 num        = -1;
            int                 num2       = -1;
            bool                flag       = false;
            NcEffectBehaviour[] components = transform.GetComponents <NcEffectBehaviour>();
            NcEffectBehaviour[] array2     = components;
            for (int j = 0; j < array2.Length; j++)
            {
                NcEffectBehaviour ncEffectBehaviour = array2[j];
                int animationState = ncEffectBehaviour.GetAnimationState();
                if (animationState != 0)
                {
                    if (animationState == 1)
                    {
                        num = 1;
                    }
                }
                else
                {
                    num = 0;
                }
            }
            if (transform.particleSystem != null)
            {
                num2 = 0;
                if (NgObject.IsActive(transform.gameObject) && ((transform.particleSystem.enableEmission && transform.particleSystem.IsAlive()) || 0 < transform.particleSystem.particleCount))
                {
                    num2 = 1;
                }
            }
            if (num2 < 1 && transform.particleEmitter != null)
            {
                num2 = 0;
                if (NgObject.IsActive(transform.gameObject) && (transform.particleEmitter.emit || 0 < transform.particleEmitter.particleCount))
                {
                    num2 = 1;
                }
            }
            if (transform.renderer != null && transform.renderer.enabled && NgObject.IsActive(transform.gameObject))
            {
                flag = true;
            }
            if (0 < num)
            {
                return(true);
            }
            if (num2 == 1)
            {
                return(true);
            }
            if (flag && (transform.GetComponent <MeshFilter>() != null || transform.GetComponent <TrailRenderer>() != null || transform.GetComponent <LineRenderer>() != null))
            {
                return(true);
            }
        }
        return(false);
    }
示例#9
0
 private void Update()
 {
     if (!this.m_bStartDetach)
     {
         this.m_bStartDetach = true;
         if (base.get_transform().get_parent() != null)
         {
             this.m_ParentGameObject = base.get_transform().get_parent().get_gameObject();
             NcDetachObject.Create(this.m_ParentGameObject, base.get_transform().get_gameObject());
         }
         GameObject rootInstanceEffect = NcEffectBehaviour.GetRootInstanceEffect();
         if (this.m_bFollowParentTransform)
         {
             this.m_OriginalPos.SetLocalTransform(base.get_transform());
             base.ChangeParent(rootInstanceEffect.get_transform(), base.get_transform(), false, null);
             this.m_OriginalPos.CopyToLocalTransform(base.get_transform());
         }
         else
         {
             base.ChangeParent(rootInstanceEffect.get_transform(), base.get_transform(), false, null);
         }
         if (!this.m_bParentHideToStartDestroy)
         {
             this.StartDestroy();
         }
     }
     if (0f < this.m_fStartDestroyTime)
     {
         if (0f < this.m_fSmoothDestroyTime)
         {
             if (this.m_bSmoothHide)
             {
                 float num = 1f - (NcEffectBehaviour.GetEngineTime() - this.m_fStartDestroyTime) / this.m_fSmoothDestroyTime;
                 if (num < 0f)
                 {
                     num = 0f;
                 }
                 if (this.m_bMeshFilterOnlySmoothHide)
                 {
                     MeshFilter[] componentsInChildren = base.get_transform().GetComponentsInChildren <MeshFilter>(true);
                     for (int i = 0; i < componentsInChildren.Length; i++)
                     {
                         Color[] colors = componentsInChildren[i].get_mesh().get_colors();
                         for (int j = 0; j < colors.Length; j++)
                         {
                             Color color = colors[j];
                             color.a  -= num;
                             colors[j] = color;
                         }
                         componentsInChildren[i].get_mesh().set_colors(colors);
                     }
                 }
                 else
                 {
                     Renderer[] componentsInChildren2 = base.get_transform().GetComponentsInChildren <Renderer>(true);
                     for (int k = 0; k < componentsInChildren2.Length; k++)
                     {
                         Renderer renderer          = componentsInChildren2[k];
                         string   materialColorName = NcEffectBehaviour.GetMaterialColorName(renderer.get_material());
                         if (materialColorName != null)
                         {
                             Color color2 = renderer.get_material().GetColor(materialColorName);
                             color2.a -= num;
                             renderer.get_material().SetColor(materialColorName, color2);
                         }
                     }
                 }
             }
             if (this.m_fStartDestroyTime + this.m_fSmoothDestroyTime < NcEffectBehaviour.GetEngineTime())
             {
                 Object.Destroy(base.get_gameObject());
             }
         }
     }
     else if (this.m_bParentHideToStartDestroy && (this.m_ParentGameObject == null || !NcEffectBehaviour.IsActive(this.m_ParentGameObject)))
     {
         this.StartDestroy();
     }
     if (this.m_bFollowParentTransform && this.m_ParentGameObject != null && this.m_ParentGameObject.get_transform() != null)
     {
         NcTransformTool ncTransformTool = new NcTransformTool();
         ncTransformTool.SetTransform(this.m_OriginalPos);
         ncTransformTool.AddTransform(this.m_ParentGameObject.get_transform());
         ncTransformTool.CopyToLocalTransform(base.get_transform());
     }
 }