public void Rebind(RebindOption bindOpt)
 {
     if (Application.isPlaying)
     {
         Transform tr = bindOpt.FindTr(m_trPath);
         m_runtimeCp = null;
         if (tr != null)
         {
             m_runtimeCp = tr.GetComponent(m_compType);
             if (m_runtimeCp == null)
             {
                 Dbg.LogWarn("RebindCp.Rebind: failed to get cp \"{0}\" on \"{1}\"", m_compType, m_trPath);
             }
         }
         else
         {
             Dbg.LogWarn("RebindCp.Rebind: failed to find \"{0}\"", m_trPath);
         }
     }
     else
     {
         Transform tr = bindOpt.FindTr(m_trPath); //even editTimeTr not null, it could be stale
         if (tr != null)
         {
             m_editTimeCp = tr.GetComponent(m_compType);
         }
     }
 }
Beispiel #2
0
        public override void rebind(RebindOption opt)
        {
            base.rebind(opt);
            _obj.Rebind(opt);

            rebind4Actions(opt);
        }
Beispiel #3
0
        public override void unbind(RebindOption opt)
        {
            base.unbind(opt);
            _obj.Unbind();

            unbind4Actions(opt);
        }
Beispiel #4
0
 public void Rebind(RebindOption bindOpt)
 {
     if (Application.isPlaying)
     {
         m_runtimeTr = bindOpt.FindTr(trPath);
     }
     else
     {
         m_editTimeTr = bindOpt.FindTr(trPath); //even editTimeTr not null, it could be stale
     }
 }