Exemplo n.º 1
0
    public void Initialize(ServerAction action)
    {
        primaryAgent.ProcessControlCommand(action);
        this.renderImage       = action.renderImage;
        this.renderClassImage  = action.renderClassImage;
        this.renderDepthImage  = action.renderDepthImage;
        this.renderObjectImage = action.renderObjectImage;



        StartCoroutine(addAgents(action));
    }
Exemplo n.º 2
0
    private void addAgent(ServerAction action)
    {
        Vector3 clonePosition = agentStartPosition(primaryAgent);

        if (clonePosition.magnitude > 0)
        {
            GameObject visCapsule = primaryAgent.transform.Find("VisibilityCapsule").gameObject;
            visCapsule.SetActive(true);


            DiscreteRemoteFPSAgentController clone = UnityEngine.Object.Instantiate(primaryAgent);
            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);
        }
        else
        {
            Debug.LogError("couldn't find a valid start position for a new agent");
        }
    }