Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - reddo

Pages: [1]
1
Support / OnCountryClick method with WPM Globe Lite
« on: February 10, 2019, 08:49:37 PM »
I'm wishing to use the OnCountryClick method from the script example on the forum for WPM Globe Lite but I can't access it as it doesn't contain the definition. Is Click events possible with Globe lite?
Thanks for any info
 
The code used is

Code
using UnityEngine;
using WPM;

public class CountryClick : MonoBehaviour
{

    WorldMapGlobe map;

    void Start()
    {
        map = WorldMapGlobe.instance;
        map.OnCountryEnter += Map_OnCountryEnter;
        map.OnCountryClick += Map_OnCountryClick;
        map.OnCountryExit += Map_OnCountryExit;
    }

    void Map_OnCountryEnter(int countryIndex, int regionIndex)
    {
        Debug.Log("Entered country: " + map.countries[countryIndex].name);
    }


    void Map_OnCountryClick(int countryIndex, int regionIndex)
    {
        Debug.Log("Click on country: " + map.countries[countryIndex].name);
    }

    void Map_OnCountryExit(int countryIndex, int regionIndex)
    {
        Debug.Log("Exited country: " + map.countries[countryIndex].name);

    }

}

Pages: [1]