Ejemplo n.º 1
0
 private void SwitchSide()
 {
     MapManager.ChangeMap(nextMap);
     if (whereToSwitch != Sides.Noone && !isMoving)
     {
         if (whereToSwitch == Sides.Right)
         {
             Vector3 position = transform.position;
             position.x         = -4.46f;
             transform.position = position;
         }
         if (whereToSwitch == Sides.Left)
         {
             Vector3 position = transform.position;
             position.x         = 4.5f;
             transform.position = position;
         }
         if (whereToSwitch == Sides.Top)
         {
             Vector3 position = transform.position;
             position.y         = -4.8f;
             transform.position = position;
         }
         if (whereToSwitch == Sides.Bot)
         {
             Vector3 position = transform.position;
             position.y         = 4.8f;
             transform.position = position;
         }
         whereToSwitch = Sides.Noone;
         AdventureGame.SaveGame();
     }
 }
Ejemplo n.º 2
0
    void OnTriggerStay2D(Collider2D other)
    {
        if (!CharacterMovement.instance.isMoving && EnemyCombatFlags.enemysPerLevel[enemyID])
        {
            AdventureGame.SaveGame();
            EnemyCombatFlags.enemysPerLevel[enemyID] = false;
            string[] cards = GetComponentInParent <EnemyInfo>().cardIDs;
            combatMsg = GetComponentInParent <EnemyInfo>().combatMsg;

            ICardDatabase repo = Repository.GetCardDatabaseInstance();
            if (AdventureDeck.DeckOpponent != null)
            {
                AdventureDeck.DeckOpponent.Clear();
            }
            else
            {
                AdventureDeck.DeckOpponent = new List <Card>();
            }
            foreach (string card in cards)
            {
                AdventureDeck.DeckOpponent.Add(repo.GetCard(card));
            }
            SceneManager.LoadScene("AdventureCombat");
        }
    }
Ejemplo n.º 3
0
    public static void ChangeMap(int mapId)
    {
        GameObject currentMap = GameObject.Find(AdventureGame.currentMap + "(Clone)");

        Destroy(currentMap);
        string     newMapName = Maps.FindMap(mapId).name;
        GameObject newMap     = (GameObject)Instantiate(Resources.Load("AdventureResources/Maps/" + newMapName));

        DontDestroyOnLoad(newMap);
        AdventureGame.currentMap = newMapName;
        AdventureGame.SaveGame();
    }