Example #1
0
    private void OnHotspotClicked(
        HotspotWidget hotspotWidget,
        WidgetEvent widgetEvent)
    {
        if (m_currentNavRef.IsValid)
        {
            WidgetEvent.MouseClickEventParameters eventParameters =
                widgetEvent.EventParameters as WidgetEvent.MouseClickEventParameters;
            Point2d     clickPoint  = new Point2d(eventParameters.worldX, eventParameters.worldY);
            HotspotInfo hotspotInfo = hotspotWidget.Userdata as HotspotInfo;

            switch (hotspotInfo.hotspotType)
            {
            case eHotspotType.energy_tank:
            {
                EnergyTankData energyTankData = hotspotInfo.hotspotEntity as EnergyTankData;

                m_contextOverlayController.OnEnergyTankClicked(clickPoint, energyTankData);
            }
            break;

            case eHotspotType.portal:
            {
                RoomPortal portal = hotspotInfo.hotspotEntity as RoomPortal;

                m_contextOverlayController.OnPortalClicked(clickPoint, portal);
            }
            break;
            }
        }
    }