Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: reddo
« on: February 11, 2019, 12:53:28 AM »

Ok, thanks very much for the info.
Posted by: Kronnect
« on: February 11, 2019, 12:12:22 AM »

Hi,

Events are not included in the Lite version of the asset.
You could use map.countryHighlightedIndex property and check if that property is >=0 along Input.GetMouseDown(0) to detect clicks on a country.

Regards


Posted by: reddo
« 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);

    }

}