Beispiel #1
0
    public void ResetArena()
    {
        foreach (GameObject holder in transform.FindChildrenWithTag("spawnedObjects"))
        {
            holder.SetActive(false);
            Destroy(holder);
        }

        ArenaConfiguration newConfiguration;

        if (!_environmentManager.GetConfiguration(arenaID, out newConfiguration))
        {
            newConfiguration = new ArenaConfiguration(prefabs);
            _environmentManager.AddConfiguration(arenaID, newConfiguration);
        }
        _arenaConfiguration = newConfiguration;
        if (_arenaConfiguration.toUpdate)
        {
            _arenaConfiguration.SetGameObject(prefabs.GetList());
            _builder.Spawnables          = _arenaConfiguration.spawnables;
            _arenaConfiguration.toUpdate = false;
            agent.maxStep = _arenaConfiguration.T * _agentDecisionInterval;
        }

        _builder.Build();
        _arenaConfiguration.lightsSwitch.Reset();
    }
Beispiel #2
0
    public override void ResetArea()
    {
        DestroyImmediate(transform.FindChildWithTag("spawnedObjects"));

        ArenaConfiguration newConfiguration;

        if (_arenasConfigurations.configurations.TryGetValue(arenaID, out newConfiguration))
        {
            _arenaConfiguration = newConfiguration;
            if (_arenaConfiguration.toUpdate)
            {
                _arenaConfiguration.SetGameObject(prefabs.GetList());
                _builder.Spawnables           = _arenaConfiguration.spawnables;
                _arenaConfiguration.toUpdate  = false;
                agent.agentParameters.maxStep = _arenaConfiguration.T * _agentDecisionInterval;
            }
        }
        _builder.Build();
        _arenaConfiguration.lightsSwitch.Reset();
    }