private void OnTriggerEnter2D(Collider2D other)
    {
        if (GameObjectIsPlayer(other.gameObject))
        {
            if (CheckIfPlayerHasntEntered(other.gameObject))
            {
                playersWhoArrived++;
                Debug.Log("Players who arrived: " + playersWhoArrived);

                if (playersWhoArrived == playersToArrive)
                {
                    if (needsExp)
                    {
                        CheckIfExpIsEnough();
                    }
                    else
                    {
                        if (levelManager.GetLocalPlayerController().controlOverEnemies)
                        {
                            levelManager.GoToNextScene();
                        }
                    }
                }

                else
                {
                    if (other.gameObject.GetComponent <PlayerController>().localPlayer)
                    {
                        levelManager.ActivateNPCFeedback("Asegúrate de que lleguen los demás");
                    }
                }
            }
        }
    }
 private void HandleActivationNpcLog(string[] msg)
 {
     if (NotInClientScene())
     {
         LevelManager levelManager = GameObject.FindObjectOfType <LevelManager>();
         levelManager.ActivateNPCFeedback(msg[1]);
     }
 }
 private void CrushWithBlocker()
 {
     numberOfHits++;
     if (numberOfHits == 1 || numberOfHits == 3 || numberOfHits == 5)
     {
         LevelManager lManager = FindObjectOfType <LevelManager>();
         lManager.ActivateNPCFeedback("Algo está bloqueando la roca... debe haber un modo de abrirla");
     }
 }
Esempio n. 4
0
    private void HandleActivationNpcLog(string[] msg)
    {
        Scene currentScene = SceneManager.GetActiveScene();

        if (currentScene.name == "ClientScene")
        {
            return;
        }
        LevelManager levelManager = GameObject.FindObjectOfType <LevelManager>();

        levelManager.ActivateNPCFeedback(msg[1]);
    }
 protected void CheckIfEndsWithEndOfScene(GameObject other)
 {
     if (finishesScene)
     {
         playersArrived++;
         Debug.Log("playersArrived: " + playersArrived);
         if (playersArrived == playersNeeded)
         {
             DestroyMyCollider();
             GameObject.Find("CameraEndOfScene").GetComponent <TriggerCamera>().OnEnter();
             ReadNextFeedback();
         }
         else
         {
             if (other.gameObject.GetComponent <PlayerController>().localPlayer)
             {
                 levelManager.ActivateNPCFeedback("¿Estás Solo? Así no podrás salir jamás...");
                 levelManager.localPlayer.ResumeMoving();
             }
             return;
         }
     }
 }
Esempio n. 6
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (GameObjectIsPlayer(other.gameObject))
        {
            Debug.Log(other.gameObject.name + " reached the end of the scene");

            if (++playersWhoArrived == playersToArrive)
            {
                Debug.Log("All players reached the end of the scene");
                levelManager.GoToNextScene();
            }

            else if (other.gameObject.GetComponent <PlayerController>().localPlayer)
            {
                levelManager.ActivateNPCFeedback("Asegúrate de que lleguen todos tus amigos");
            }
        }
    }
    public void UseItem(PlayerController player)
    {
        if (selectedItem == null)
        {
            LevelManager lManager = FindObjectOfType <LevelManager>();
            lManager.ActivateNPCFeedback("No hay un item en esta casilla");

            return;
        }

        ActivableSystem system = GetActivableSystem(player);

        if (system)
        {
            if (system.PlaceItem(selectedItem.Value.sprite))
            {
                RemoveItem();
            }
        }
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (GameObjectIsPlayer(collision.gameObject))
        {
            PlayerController pc = collision.gameObject.GetComponent <PlayerController>();
            pc.decisionName = name;

            if (++playersWhoArrived == 3)
            {
                pc.StopMoving();
                StartThisVoting();
            }
            else
            {
                if (collision.GetComponent <PlayerController>().localPlayer)
                {
                    levelManager.ActivateNPCFeedback("Han llegado tus compañeros?");
                }
            }
        }
    }
 protected void HandleChoice3()
 {
     levelManager.InstantiatePrefab("EngranajeA", new Vector2(-7.27f, -3.87f)); //Solucionar Vectores e instanciar nueva decisión.
     levelManager.ActivateNPCFeedback("Excelente! Los esperaré. ¡Y recuerden, 1500 de EXP!");
 }