public void Initialize(ServerAction action) { if (action.agentType != null && action.agentType.ToLower() == "stochastic") { this.agents.Clear(); // stochastic must have these set to work properly action.continuous = true; action.snapToGrid = false; GameObject fpsController = GameObject.FindObjectOfType <BaseFPSAgentController>().gameObject; primaryAgent.enabled = false; primaryAgent = fpsController.GetComponent <StochasticRemoteFPSAgentController>(); primaryAgent.agentManager = this; primaryAgent.enabled = true; // must manually call start here since it this only gets called before Update() is called primaryAgent.Start(); this.agents.Add(primaryAgent); } primaryAgent.ProcessControlCommand(action); primaryAgent.IsVisible = action.makeAgentsVisible; this.renderClassImage = action.renderClassImage; this.renderDepthImage = action.renderDepthImage; this.renderNormalsImage = action.renderNormalsImage; this.renderObjectImage = action.renderObjectImage; this.renderFlowImage = action.renderFlowImage; if (action.alwaysReturnVisibleRange) { ((PhysicsRemoteFPSAgentController)primaryAgent).alwaysReturnVisibleRange = action.alwaysReturnVisibleRange; } StartCoroutine(addAgents(action)); }
public void Initialize(ServerAction action) { primaryAgent.ProcessControlCommand(action); primaryAgent.IsVisible = action.makeAgentsVisible; this.defaultRenderImage = action.renderImage; this.renderClassImage = action.renderClassImage; this.renderDepthImage = action.renderDepthImage; this.renderNormalsImage = action.renderNormalsImage; this.renderObjectImage = action.renderObjectImage; StartCoroutine(addAgents(action)); }
private void addAgent(ServerAction action) { Vector3 clonePosition = new Vector3(action.x, action.y, action.z); BaseFPSAgentController clone = UnityEngine.Object.Instantiate(primaryAgent); clone.IsVisible = action.makeAgentsVisible; clone.actionDuration = this.actionDuration; // clone.m_Camera.targetDisplay = this.agents.Count; clone.transform.position = clonePosition; UpdateAgentColor(clone, agentColors[this.agents.Count]); clone.ProcessControlCommand(action); this.agents.Add(clone); }
public void Initialize(ServerAction action) { primaryAgent.ProcessControlCommand(action); primaryAgent.IsVisible = action.makeAgentsVisible; this.renderClassImage = action.renderClassImage; this.renderDepthImage = action.renderDepthImage; this.renderNormalsImage = action.renderNormalsImage; this.renderObjectImage = action.renderObjectImage; if (action.alwaysReturnVisibleRange) { ((PhysicsRemoteFPSAgentController)primaryAgent).alwaysReturnVisibleRange = action.alwaysReturnVisibleRange; } StartCoroutine(addAgents(action)); }
private void addAgent(ServerAction action) { Vector3 clonePosition = new Vector3(action.x, action.y, action.z); //disable ambient occlusion on primary agetn because it causes issues with multiple main cameras //primaryAgent.GetComponent<PhysicsRemoteFPSAgentController>().DisableScreenSpaceAmbientOcclusion(); BaseFPSAgentController clone = UnityEngine.Object.Instantiate(primaryAgent); clone.IsVisible = action.makeAgentsVisible; clone.actionDuration = this.actionDuration; // clone.m_Camera.targetDisplay = this.agents.Count; clone.transform.position = clonePosition; UpdateAgentColor(clone, agentColors[this.agents.Count]); clone.ProcessControlCommand(action); this.agents.Add(clone); }