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); } } }
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 } }