Beispiel #1
0
    protected void RunActionControl(int nPlayIndex, int nTransIndex)
    {
        NgUtil.LogDevelop("RunActionControl() - nPlayIndex " + nPlayIndex);

        CancelInvoke("CreateInstanceEffect");
        m_bCalledDelayCreate = false;

        // 정지된 시계일 경우 움직이도록 해두자...
        ResumeTimeScale();

        // Play ---------------------------------------
        m_bStartAliveAnimation = false;
        switch (nPlayIndex)
        {
        /*AutoRet*/
        case 0: break;

        case 1: break;

        /*OneShot*/
        case 2: SetTimeScale(m_fPlayToolbarTimes[nPlayIndex]);  break;

        /*Repeat*/
        case m_nRepeatIndex:
        case m_nRepeatIndex + 1:
        case m_nRepeatIndex + 2:
        case m_nRepeatIndex + 3:
        case m_nRepeatIndex + 4: {
            // repeat선택이면.. 이동관련 옵션을 끈다.
            if (nPlayIndex != m_nPlayIndex)
            {
                nTransIndex = 0;
            }
            break;
        }
        }

        // Trans ---------------------------------------
        if (0 < nTransIndex)
        {
            // init multishot
//          if (m_nTransIndex != nTransIndex && (m_nTransIndex != 0 && nTransIndex != 0))
//              m_nMultiShotCount = 1;
            float           fTransHalfDist   = (Camera.mainCamera != null ? (Vector3.Magnitude(Camera.mainCamera.transform.position) * 0.65f) : 1) * m_fTransRate;
            GameObject      instEffectObject = FXMakerMain.inst.GetInstanceEffectObject();
            GameObject      simRoot          = NgObject.CreateGameObject(instEffectObject.transform.parent.gameObject, "simulate");
            FXMakerSimulate simComponent     = simRoot.AddComponent <FXMakerSimulate>();
            instEffectObject.transform.parent = simRoot.transform;
            FXMakerMain.inst.ChangeRoot_InstanceEffectObject(simRoot);
            simComponent.Init(this, m_nMultiShotCount);

            switch (nTransIndex)
            {
            case 1:                     // Move
            {
                simComponent.SimulateMove(m_nTransAxis, fTransHalfDist, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 2:                     // scale
            {
                simComponent.SimulateScale(m_nTransAxis, fTransHalfDist * 0.3f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 3:                     // Arc
            {
                simComponent.SimulateArc(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 4:                     // fall
            {
                simComponent.SimulateFall(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 5:                     // raise
            {
                simComponent.SimulateRaise(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 6:                     // circle
            {
                simComponent.SimulateCircle(fTransHalfDist * 0.5f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 7:                     // tornado
            {
                simComponent.SimulateTornado(fTransHalfDist * 0.3f, fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }
            }
        }

        // 이동처리중이면... 자동반복되므로 기존repeat옵션은 끈다.
        if (0 < nTransIndex)
        {
            if (m_nRepeatIndex <= nPlayIndex)
            {
                nPlayIndex = 0;
            }
        }

        // 최족 결정값 저장
        m_nPlayIndex  = nPlayIndex;
        m_nTransIndex = nTransIndex;

        if (IsRepeat())
        {
            m_fCreateTime = Time.time;
        }
    }
Beispiel #2
0
    protected void RunActionControl(int nPlayIndex, int nTransIndex)
    {
        NgUtil.LogDevelop("RunActionControl() - nPlayIndex " + nPlayIndex);

        CancelInvoke("CreateInstanceEffect");
        m_bCalledDelayCreate = false;

        // チ、チ?オネ ステー霏マ ー豼?ソ?チ?タフオオキマ ヌリオホタレ...
        ResumeTimeScale();

        // Play ---------------------------------------
        m_bStartAliveAnimation = false;
        switch (nPlayIndex)
        {
        /*AutoRet*/
        case 0: break;

        case 1: break;

        /*OneShot*/
        case 2: SetTimeScale(m_fPlayToolbarTimes[nPlayIndex]);  break;

        /*Repeat*/
        case m_nRepeatIndex:
        case m_nRepeatIndex + 1:
        case m_nRepeatIndex + 2:
        case m_nRepeatIndex + 3:
        case m_nRepeatIndex + 4: {
            // repeatシアナテタフク?. タフオソー?キテ ソノシヌタサ イ?エル.
            if (nPlayIndex != m_nPlayIndex)
            {
                nTransIndex = 0;
            }
            break;
        }
        }

        // Trans ---------------------------------------
        if (0 < nTransIndex)
        {
            // init multishot
//          if (m_nTransIndex != nTransIndex && (m_nTransIndex != 0 && nTransIndex != 0))
//              m_nMultiShotCount = 1;
// 2016.10.07 長坂 メインカメラ固定になってうため、変更できるように修正.
#if __DRECOM_
            float fTransHalfDist = (NcUtility.Camera != null ? (Vector3.Magnitude(NcUtility.Camera.transform.position) * 0.65f) : 1) * m_fTransRate;
#else
            float fTransHalfDist = (Camera.main != null ? (Vector3.Magnitude(Camera.main.transform.position) * 0.65f) : 1) * m_fTransRate;
#endif
            GameObject      instEffectObject = FXMakerMain.inst.GetInstanceEffectObject();
            GameObject      simRoot          = NgObject.CreateGameObject(instEffectObject.transform.parent.gameObject, "simulate");
            FXMakerSimulate simComponent     = simRoot.AddComponent <FXMakerSimulate>();
            instEffectObject.transform.parent = simRoot.transform;
            FXMakerMain.inst.ChangeRoot_InstanceEffectObject(simRoot);
            simComponent.Init(this, m_nMultiShotCount);

            switch (nTransIndex)
            {
            case 1:                     // Move
            {
                simComponent.SimulateMove(m_nTransAxis, fTransHalfDist, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 2:                     // scale
            {
                simComponent.SimulateScale(m_nTransAxis, fTransHalfDist * 0.3f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 3:                     // Arc
            {
                simComponent.SimulateArc(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 4:                     // fall
            {
                simComponent.SimulateFall(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 5:                     // raise
            {
                simComponent.SimulateRaise(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 6:                     // circle
            {
                simComponent.SimulateCircle(fTransHalfDist * 0.5f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }

            case 7:                     // tornado
            {
                simComponent.SimulateTornado(fTransHalfDist * 0.3f, fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0));
                break;
            }
            }
        }

        // タフオソテウクョチ゚タフク?.. タレオソケンコケオヌケヌキホ ア簔クrepeatソノシヌタコ イ?エル.
        if (0 < nTransIndex)
        {
            if (m_nRepeatIndex <= nPlayIndex)
            {
                nPlayIndex = 0;
            }
        }

        // テヨチキ ー眞、ーェ タ?タ?
        m_nPlayIndex  = nPlayIndex;
        m_nTransIndex = nTransIndex;

        if (IsRepeat())
        {
            m_fCreateTime = Time.time;
        }
    }