private void InsertMapLevel(int ind, List <LvlButtonController> lvlButtonControllers) { Vector2 position = GetInterpolatedPosition(ind, lvlButtonControllers); MapLoader mapLoader = FindObjectOfType <MapLoader>(); LvlButtonController mapLevel = CreateMapLevel(ind, mapLoader.lvlBtnPrefab); mapLevel.transform.SetParent(_lvlButtonController.transform.parent, false); mapLevel.transform.SetSiblingIndex(ind); mapLevel.transform.position = position; lvlButtonControllers.Insert(ind, mapLevel); UpdateLevelsNumber(lvlButtonControllers); Selection.activeGameObject = mapLevel.gameObject; }
private void OnEnable() { _lvlButtonController = target as LvlButtonController; DeletePendingGameObject(); }
protected LvlButtonController CreateMapLevel(int number, LvlButtonController mapLevelPrefab) { LvlButtonController mapLevel = PrefabUtility.InstantiatePrefab(mapLevelPrefab) as LvlButtonController; return(mapLevel); }