Ejemplo n.º 1
0
    protected override void onStart()
    {
        unitMgr = new Unit.Mgr(false);
        Player u = unitMgr.getUnit(0, UnitType.Player, 1002) as Player;

        u.setParam(bornPos, Vector3.forward);
        player = u;

        Camera.main.gameObject.AddComponent <CameraController4First>();
        WindowMgr.single.GetWindow("ActMainWindow", true);
        EventMgr.single.PostEvent("Game.Player", player);
    }
Ejemplo n.º 2
0
    void onDisconnected(NetworkMessage msg)
    {
        Client c = getClient(msg.conn);

        if (c == null)
        {
            return;
        }
        Log.i("LanHost onDisconnected accountId=" + c.accoundId + ",connecttionId=" + msg.conn.connectionId, Log.Tag.Net);
        Unit u = mUnitMgr.getUnit(c.playerGUID);

        if (u != null)
        {
            u.decState(UnitState.Exist, true);
        }
        mClients.Remove(msg.conn.connectionId);
        c.deinit();
    }
Ejemplo n.º 3
0
    void createPlayer(MsgCreate m)
    {
        Player u = mUnitMgr.getUnit(m.guid, UnitType.Player, m.tid) as Player;

        u.agentId = m.agentId;
        u.onSyncState(m);
        u.setParam(m.pos, m.dir);
        if (u.isAgent)
        {
            EventMgr.single.SendEvent("Game.Player", u);
        }
    }