Example #1
0
    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();
        }
    }
Example #2
0
 public void SetGotoIsland(DataIsland _gotoIsland)
 {
     this.gotoIsland = _gotoIsland;
 }
Example #3
0
 public void SetActive(DataIsland _activeIsland)
 {
     this.activeIsland = _activeIsland;
 }
Example #4
0
 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();
 }