Exemple #1
0
    public void OnAgentStop(NetworkMessage netMsg)
    {
        MObjects.AgentStop mObject = netMsg.ReadMessage <MObjects.AgentStop>();

        MobileAgent ma = MobileAgent.list.Find(x => x.id == mObject.id);

        if (ma == null || (ma.isController && !mObject.includeClient))
        {
            return;
        }

        ma.Stop();
    }
Exemple #2
0
    public void Stop(bool urgent = false)
    {
        targetPoint = Vector3.up;

        MObjects.AgentStop mObject = new MObjects.AgentStop();
        mObject.id            = (user != null) ? user.connectionId : customId;
        mObject.includeClient = urgent;

        int _c = session.users.Count;

        for (int i = 0; i < _c; i++)
        {
            if (NetworkServer.connections.Contains(session.users[i]))
            {
                // send the mobject
                NetworkServer.SendToClient(session.users[i].connectionId, MTypes.AgentStop, mObject);
            }
        }
    }