private void CheckMiniPetVisibleInPartition(object sender, PartitionChangedArgs args)
    {
        int    currentPartition = args.newPartition;
        string currentArea      = GatingManager.Instance.CurrentZone;

        CheckMiniPetVisibleInPartition(currentArea, currentPartition);
    }
    /// <summary>
    /// Degrad emitters need to know about partition changes so they can stop
    /// spawning particles when changing to a gated room.
    /// </summary>
    private void OnPartitionChanging(object sender, PartitionChangedArgs args)
    {
        bool bGated = false;

        if (GatingManager.Instance)
        {
            // find out if the room being changed to has a gate or not
            bGated = GatingManager.Instance.HasActiveGate(args.newPartition);
        }

        if (bGated)
        {
            // if there is a gate in this room, turn off the spawning of skulls
            Disable();

            // also, all spawned objects need to get to their target asap
            for (int i = 0; i < listSpawned.Count; ++i)
            {
                GameObject  go         = listSpawned[i];
                MoveTowards moveScript = go.GetComponent <MoveTowards>();
                moveScript.FlashToTarget();
            }
        }
        else
        {
            // if there is no gate in this room, we can spawn skulls again (but only if the tut is through)
            if (!isActive)
            {
                Enable();
            }
        }
    }
Esempio n. 3
0
    //---------------------------------------------------
    // MovePetWithCamera()
    //Pet will follow the camera when the partition has been changed
    //---------------------------------------------------
    public void MovePetWithCamera(object sender, PartitionChangedArgs arg)
    {
        bool hasActiveGate = GatingManager.Instance.HasActiveGate(arg.newPartition);

        if (!hasActiveGate)
        {
            // first add a temporary exception so the pet can move freely
            ClickManager.Instance.AddTemporaryException(ClickLockExceptions.Moving);

            //Transform pet position to screen point first so we can move the pet to the right y position
            MovePet(mainCamera.ScreenPointToRay(new Vector3(Screen.width / 2, movementStaticScreenY, 0)));
        }
    }
Esempio n. 4
0
    /// <summary>
    /// Entereds the room.
    /// NOTE: Currently, exiting a gated room into another gated room is not by design,
    /// and also not supported
    /// </summary>
    /// <param name="sender">Sender.</param>
    /// <param name="args">Arguments.</param>
    public void EnteredRoom(object sender, PartitionChangedArgs args)
    {
        int leavingPartitionNumber  = args.oldPartition;
        int enteringPartitionNumber = args.newPartition;

        bool isGateLeavingActive  = HasActiveGate(currentZone, leavingPartitionNumber);
        bool isGateEnteringActive = HasActiveGate(currentZone, enteringPartitionNumber);

        if (isGateEnteringActive)
        {
            // if the player is entering a gated room, hide some ui and lock the click manager
            List <ClickLockExceptions> listExceptions = new List <ClickLockExceptions>();
            listExceptions.Add(ClickLockExceptions.Moving);
            ClickManager.Instance.Lock(UIModeTypes.GatingSystem, listExceptions);

            NavigationUIManager.Instance.HidePanel();

            // let the gate know that the player has entered the room
            Gate gate = (Gate)activeGates[enteringPartitionNumber];
            gate.GreetPlayer();

            // also, move the player to a specific location
            MovePlayer(enteringPartitionNumber);

            // we neeed to listen to when the player is done moving to handle other gate related stuff
            ListenForMovementFinished(true);
        }
        else
        {
            // if the pet is leaving a gated room, destroy the fire UI and stop listening for a callback
            ListenForMovementFinished(false);
        }

        // if they are entering a non-gated room from a gated room, show that ui and unlock click manager
        if (isGateLeavingActive && !isGateEnteringActive)
        {
            EnableUI();
        }
    }
Esempio n. 5
0
 public void OnPartitionChanging(object sender, PartitionChangedArgs args)
 {
     // if the partition is changing at all, destroy this UI
     Deactivate();
 }
Esempio n. 6
0
 /// <summary>
 /// Entered the room. When player switches rooms.
 /// </summary>
 private void EnteredRoom(object sender, PartitionChangedArgs args)
 {
     // do a check in case a tutorial was in a different room
     IsPlayTutorial();
 }