Esempio n. 1
0
    void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            MatriceMap MatriceMap = FindObjectOfType <MatriceMap>();
            Player     player     = FindObjectOfType <Player>();

            if (player.transform.lossyScale.x < 0)
            {
                MatriceMap.Next_Map_On_Left(player.Pos_X_Matrice, player.Pos_Y_Matrice);
            }
            else
            {
                MatriceMap.Next_Map_On_Right(player.Pos_X_Matrice, player.Pos_Y_Matrice);
            }
        }
    }