Exemplo n.º 1
0
    public void Clear()
    {
        if (!_isInitialized)
        {
            return;
        }

        _costMap.Clear();
        _dangerMap.Clear();
        _goalMap.Clear();
        _entitiesMap.Clear();

        foreach (var aiPlayer in _gameManager.AIManager.AIPlayers)
        {
            aiPlayer.Behaviour.OnPathChanged.RemoveListener(OnPlayerPathChanged);
            aiPlayer.Behaviour.OnTargetReached.RemoveListener(OnPlayerTargetReached);
        }

        foreach (var keyValuePair in _pathSprites)
        {
            foreach (var sprite in keyValuePair.Value)
            {
                Destroy(sprite.gameObject);
            }
        }

        _pathSprites.Clear();

        _isInitialized = false;
    }
Exemplo n.º 2
0
    public void ResetGen()
    {
        save     = false;
        saveData = null;
        done     = false;

        ActivateMinimap(false);

        GameObject gen = GameObject.Find("Generator");

        gen.TryGetComponent <BiomeGenerator>(out BiomeGenerator BG);
        gen.TryGetComponent <TerrainGenerator>(out TerrainGenerator TG);

        if (TG != null)
        {
            Destroy(TG);
        }
        if (BG != null)
        {
            Destroy(BG);
        }

        gen.AddComponent <TerrainGenerator>();
        foreach (Transform child in gen.transform)
        {
            if (child.name != "Outline")
            {
                if (child.gameObject != null)
                {
                    Destroy(child.gameObject);
                }
            }
            else
            {
                child.gameObject.SetActive(false);
            }
        }

        minimap.Clear();

        PdebugText.alignment = TextAlignmentOptions.Left;
        PdebugText.SetText("");
        SdebugText.alignment = TextAlignmentOptions.Left;
        SdebugText.rectTransform.anchorMin = new Vector2(0, 1);
        SdebugText.rectTransform.anchorMax = new Vector2(1, 1);
        Vector2 anchPos = SdebugText.rectTransform.anchoredPosition;

        anchPos.y = -130;
        SdebugText.rectTransform.anchoredPosition = anchPos;
        SdebugText.SetText("");

        stopwatch.Stop();
        stopwatch = new System.Diagnostics.Stopwatch();
        Timer.SetText("00:00.000");
        stopwatch.Start();
    }
Exemplo n.º 3
0
 public void ClearEnemyMiniMap()
 {
     _enemyMinimap.Clear();
 }
Exemplo n.º 4
0
 public void ClearMiniMap()
 {
     _playersPool.ReturnObjects();
     PlayersDrawedOnMinimap = 0;
     _minimap.Clear();
 }