public void Clicked(int id) { DataIsland clickedIsland = GetIslandById(id); int distance = (int)Vector3.Distance(clickedIsland.island.transform.position, activeIsland.island.transform.position)*4; //print(clickedIsland.name + "Clicked : " + id + " clickedIsland: " + clickedIsland.island.transform.localPosition + " activeIsland: " + activeIsland.island.transform.localPosition + " distance: " + distance); if (distance > 1) { clickedIsland.distance = distance; Events.Map_OpenIslandSignal(clickedIsland); } else { gotoIsland = new DataIsland(); Game.Instance.mainMenu.Isla(); } }
public void SetGotoIsland(DataIsland _gotoIsland) { this.gotoIsland = _gotoIsland; }
public void SetActive(DataIsland _activeIsland) { this.activeIsland = _activeIsland; }
void Start() { activeIsland = GetIslandById( Data.Instance.userData.islandActive ); SetNewMission(Data.Instance.userData.missionActive); Events.OnNewMission += OnNewMission; int a = 1; foreach (DataIsland dataIsland in islands) { dataIsland.progress = PlayerPrefs.GetInt("progressIsland_" + a, 0); a++; } Events.OnMinigameReady += OnMinigameReady; DebugIslands(); }