public void Init(MineralRoot root) { if (root == null) { return; } m_Root = root; GamingMapArea gamingArea = root.m_GamingMapArea; if (gamingArea != null) { Area[] areas = FindObjectsOfType <Area>(); if (areas != null && areas.Length > 0) { for (int iArea = 0; iArea < areas.Length; iArea++) { Area area = areas[iArea]; if (area.Uid == gamingArea.m_AreaId) { m_Marks = area.GetMineralSemaphoreMarks(); m_RootMark = area.m_MineralRoot; } } } } }
private void OnEnable() { m_Target = target as MineralRoot; GamingMapArea gamingArea = m_Target.m_GamingMapArea; if (gamingArea != null) { Area[] areas = FindObjectsOfType <Area>(); if (areas != null && areas.Length > 0) { for (int iArea = 0; iArea < areas.Length; iArea++) { Area area = areas[iArea]; if (area.Uid == gamingArea.m_AreaId) { marks = area.GetMineralSemaphoreMarks(); } } } } }