Beispiel #1
0
    public void DestroyAgent(GameObject go)
    {
        if (SimulatorManager.Instance.IsAPI)
        {
            SimulatorManager.Instance.EnvironmentEffectsManager.ClearRainVFX(go.transform);
        }

        var controller = go.GetComponent <IAgentController>();

        if (controller != null)
        {
            SimulatorManager.Instance.SegmentationIdMapping.RemoveSegmentationId(controller.GTID);
        }

        ActiveAgents.RemoveAll(config => config.AgentGO == go);
        Destroy(go);

        if (ActiveAgents.Count == 0)
        {
            SimulatorManager.Instance.CameraManager.SetFreeCameraState();
        }
        else
        {
            SetCurrentActiveAgent(0);
        }
    }
Beispiel #2
0
    public void DestroyAgent(GameObject go)
    {
        ActiveAgents.RemoveAll(config => config.AgentGO == go);
        Destroy(go);

        if (ActiveAgents.Count == 0)
        {
            SimulatorManager.Instance.CameraManager.SetFreeCameraState();
        }
        else
        {
            SetCurrentActiveAgent(0);
        }
    }
Beispiel #3
0
    public void DestroyAgent(GameObject go)
    {
        if (SimulatorManager.Instance.IsAPI)
        {
            SimulatorManager.Instance.EnvironmentEffectsManager.ClearRainVFX(go.transform);
        }

        ActiveAgents.RemoveAll(config => config.AgentGO == go);
        Destroy(go);

        if (ActiveAgents.Count == 0)
        {
            SimulatorManager.Instance.CameraManager.SetFreeCameraState();
        }
        else
        {
            SetCurrentActiveAgent(0);
        }
    }
Beispiel #4
0
    public void DestroyAgent(GameObject go)
    {
        ActiveAgents.RemoveAll(config => config.AgentGO == go);
        var agentController = go.GetComponent <AgentController>();

        if (agentController != null)
        {
            agentController.SensorsChanged -= AgentControllerOnSensorsChanged;
        }
        Destroy(go);

        if (ActiveAgents.Count == 0)
        {
            SimulatorManager.Instance.CameraManager.SetFreeCameraState();
        }
        else
        {
            SetCurrentActiveAgent(0);
        }
    }