Exemplo n.º 1
0
    /// <summary>
    /// Deactivates this hotspot
    /// </summary>
    public void Deactivate(bool ShouldUnregister = true)
    {
        if (bNeedsInitialize)
        {
            Initialize();
        }

        //Remove from list
        if (ShouldUnregister)
        {
            HotspotMovement.UnregisterActiveHotspot(this);
        }

        //Call event dispatcher
        if (OnDeactivated != null)
        {
            OnDeactivated.Invoke();
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Activates this hotspot, setting it as the currently active one. Sends OnDeactivate messages to any hotspot that was activated previously
    /// </summary>
    public void Activate()
    {
        if (bNeedsInitialize)
        {
            Initialize();
        }

        //Disable any hotspot currently running
        if (RequiresFlush && ActiveHotspots.Count > 0)
        {
            HotspotMovement.Flush();
        }

        //Move the character and register
        _playerObject.SmoothTransport(new Trans(PositionOverride ? PositionOverride : gameObject.transform), -1, null, true);
        HotspotMovement.RegisterActiveHotspot(this);

        //Call event dispatcher
        if (OnActivated != null)
        {
            OnActivated.Invoke();
        }
    }
Exemplo n.º 3
0
 public static void UnregisterActiveHotspot(HotspotMovement hotspot)
 {
     ActiveHotspots.Remove(hotspot);
 }
Exemplo n.º 4
0
 public static void RegisterActiveHotspot(HotspotMovement hotspot)
 {
     ActiveHotspots.Add(hotspot);
 }