Exemplo n.º 1
0
    void OnValidate()
    {
        bool changed = false;

        if (_beforeDelayFrame != m_Sel.m_fDelayFrame)
        {
            m_Sel.m_fDelayTime = m_Sel.m_fDelayFrame * NcFrameHelper.FixedSecondPerFrame;
            _beforeDelayFrame  = m_Sel.m_fDelayFrame;
            changed            = true;
        }
        if (_beforeDelayTime != m_Sel.m_fDelayTime)
        {
            m_Sel.m_fDelayFrame = (int)(m_Sel.m_fDelayTime / NcFrameHelper.FixedSecondPerFrame);
            _beforeDelayTime    = m_Sel.m_fDelayTime;
            changed             = true;
        }
        if (_beforeDurationFrame != m_Sel.m_fDurationFrame)
        {
            m_Sel.m_fDurationTime = m_Sel.m_fDurationFrame * NcFrameHelper.FixedSecondPerFrame;
            _beforeDurationFrame  = m_Sel.m_fDurationFrame;
            changed = true;
        }
        if (_beforeDurationTime != m_Sel.m_fDurationTime)
        {
            m_Sel.m_fDurationFrame = (int)(m_Sel.m_fDurationTime / NcFrameHelper.FixedSecondPerFrame);
            _beforeDurationTime    = m_Sel.m_fDurationTime;
            changed = true;
        }
        if (changed)
        {
            NcController controller = FXMakerMain.inst.GetOriginalEffectObject().GetComponent <NcController>();
            if (controller != null)
            {
                Debug.LogFormat("controller:{0}", controller.GetInstanceID());
                Debug.LogFormat("m_sel:{0}", m_Sel.GetInstanceID());
                Debug.LogFormat("m_sel.gameObject:{0}", m_Sel.gameObject.GetInstanceID());
            }
            else
            {
                Debug.Log("controller:null");
            }
        }
    }