Exemplo n.º 1
0
    public void SetFloor()
    {
        _player = GameObject.Find("ExploreCharacter").GetComponent <ExploreCharacter>();
        _player.transform.position = _playerPosition;
        ExploreUI.Open();
        ExploreUI.Instance.InitLittleMap(_mapInfo.ID, Vector2Int.RoundToInt(_player.transform.position), _mapInfo.Start, _mapInfo.Goal, _mapInfo.MapBound, _mapInfo.MapList);
        SetVisibleRange(true);
        ExploreUI.Instance.RefreshLittleMap(Vector2Int.RoundToInt(_player.transform.position), _mapInfo.ExploredList, _mapInfo.ExploredWallList);
        SetInteractive(Vector2Int.RoundToInt(_player.transform.position));

        _pathFindList = new List <Vector2Int>(_mapInfo.MapList);
        foreach (KeyValuePair <Vector2Int, Treasure> item in _mapInfo.TreasureDic)
        {
            _pathFindList.Remove(item.Key);
        }
        for (int i = 0; i < _mapInfo.DoorList.Count; i++)
        {
            _pathFindList.Remove(_mapInfo.DoorList[i]);
        }
        foreach (KeyValuePair <Vector2Int, Event> item in _mapInfo.ExploreEventDic)
        {
            _pathFindList.Remove(item.Key);
        }

        GenerateCoin();
        GenerateEnemy(); //temp
        GameSystem.Instance.AutoSave();

        _plotChecker.Check();
    }
Exemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         character = collision.transform.parent.GetComponent <ExploreCharacter>();
         character.MoveCallback += OnCharacterMoveEnd;
     }
 }