Ejemplo n.º 1
0
 void OnDestroy()
 {
     // remember to disconnect or else a null exception might happen
     // if a listener who has been destroyed is called. Disconnecting
     // a function which has already been disconnected previously is fine.
     FFMessage <PathFollowerCompletedLoopEvent> .Disconnect(LoopCompleted);
 }
Ejemplo n.º 2
0
 void OnDestroy()
 {
     // remember to disconnect or else a null exception might happen
     // if a listener who has been destroyed is called. Disconnecting
     // a function which has already been disconnected previously is fine.
     FFMessage <PlayerDiedEvent> .Disconnect(ReportPlayerDeath);
 }
Ejemplo n.º 3
0
    // Example of a 1-off event
    void OnPlayerDiedEvent(PlayerDiedEvent e)
    {
        // It is ok to disconnect/connect/send events from within
        // an event call. However, added events within the same
        // event type will not be called on the event they are added.
        FFMessage <PlayerDiedEvent> .Disconnect(OnPlayerDiedEvent);

        Debug.Log("The Player died!, I am quite sad. I am going to be quiet now...  (One Time Event example)");
    }
Ejemplo n.º 4
0
    void OnDestroy()
    {
        FFMessageBoard <ApplyHealthEvent> .Disconnect(OnApplyHealth, gameObject);

        FFMessageBoard <EmptyHealthEvent> .Disconnect(OnHealthEmpty, gameObject);

        FFMessageBoard <ExHealth> .Disconnect(OnServerUpdate, gameObject);

        FFMessage <FFNetEvents.ClientConnectedEvent> .Disconnect(OnClientConnected);
    }
Ejemplo n.º 5
0
    private void OnDestroy()
    {
        FFMessage <EnterParty> .Disconnect(OnEnterParty);

        FFMessage <LeaveParty> .Disconnect(OnLeaveParty);

        FFMessage <EnterArea> .Disconnect(OnEnterArea);

        FFMessage <LeaveArea> .Disconnect(OnLeaveArea);
    }
Ejemplo n.º 6
0
    void OnDestroy()
    {
        { // disconnect
            FFMessage <ShowPlayerControlsEvent> .Disconnect(OnShowPlayerControlsEvent);

            FFMessage <ShowCustomTextMessage> .Disconnect(OnShowCustomTextMessage);

            FFMessage <ShowCustomIconMessage> .Disconnect(OnShowCustomIconMessage);
        }
    }
Ejemplo n.º 7
0
    void OnDestroy()
    {
        // Events
        FFMessageBoard <ExPlayerMoveAction> .Disconnect(OnPlayerMoveAction, gameObject);

        FFMessageBoard <ExPlayerFireAction> .Disconnect(OnPlayerFireAction, gameObject);

        FFMessageBoard <ExPlayerPositionUpdate> .Disconnect(OnPlayerPositionUpdate, gameObject);

        FFMessage <FFLocalEvents.UpdateEvent> .Disconnect(OnUpdateEvent);
    }
Ejemplo n.º 8
0
    void OnDestroy()
    {
        Debug.Log("FFClient Destroyed");
        _singleton = null;
        EndSendThread();

        try
        {
            if (_clientData.clientSocketTCP != null && _clientData.clientSocketTCP.socket != null && _clientData.clientSocketTCP.socket.IsBound)
            {
                _clientData.clientSocketTCP.socket.BeginDisconnect(false, new AsyncCallback(DisconnectCallback), _clientData.clientSocketTCP.socket);
                _clientData.clientSocketTCP.socket     = null;
                _clientData.clientSocketTCP.clientData = null;
                _clientData.clientSocketTCP            = null;
            }
        }
        catch (Exception exp) { Debug.Log("Error in FFServer OnDestroy() : " + exp.Message); }

        try
        {
            if (_clientData.clientSocketUDP != null && _clientData.clientSocketUDP.udpClient != null)
            {
                _clientData.clientSocketUDP.udpClient.Close();
                _clientData.clientSocketUDP.udpClient         = null;
                _clientData.clientSocketUDP.udpEndPointLocal  = null;
                _clientData.clientSocketUDP.udpEndPointRemote = null;
                _clientData.clientSocketUDP.socket            = null;
                _clientData.clientSocketUDP.clientData        = null;
                _clientData.clientSocketUDP = null;
            }
        }
        catch (Exception exp) { Debug.Log("Error in FFServer OnDestroy() : " + exp.Message); }

        FFLocalEvents.TimeChangeEvent TCE;
        TCE.newCurrentTime = FFSystem.time;
        FFMessage <FFLocalEvents.TimeChangeEvent> .SendToLocal(TCE);

        FFMessage <ClientConnectedEvent> .Disconnect(OnClientConnected);

        FFMessage <ClientSyncTimeEvent> .Disconnect(OnClientSyncTime);
    }
Ejemplo n.º 9
0
    void OnDestroy()
    {
        _clientWatch.Reset();

        // Notify any FFAction of the time shift
        FFLocalEvents.TimeChangeEvent TCE;
        TCE.newCurrentTime = FFSystem.time;
        FFMessage <FFLocalEvents.TimeChangeEvent> .SendToLocal(TCE);


        singleton.recievedMessages.Clear();
        singleton = null;
        FFMessage <ClientConnectionReadyEvent> .Disconnect(OnClientConnectionReady);

        FFMessage <GameObjectNetIdRecievedEvent> .Disconnect(OnGameObjectNetIdRecieved);

        FFMessage <NetObjectCreatedEvent> .Disconnect(OnNetObjectCreatedEvent);

        FFMessage <NetObjectDestroyedEvent> .Disconnect(OnNetObjectDestroyedEvent);

        Debug.Log("On Destroy of FFSystem, recieved Messages erased: " + recievedMessages.Count);
    }
Ejemplo n.º 10
0
 void OnDestroy()
 {
     FFMessage <ChangeLevelStateEvent> .Disconnect(OnChangeLevelStateEvent);
 }
Ejemplo n.º 11
0
 private void OnDestroy()
 {
     FFMessage <TriggerFade> .Disconnect(OnTriggerFade);
 }
Ejemplo n.º 12
0
 void OnDestroy()
 {
     FFMessage <MoneyStruct> .Disconnect(ChangeText);
 }
Ejemplo n.º 13
0
    void OnDestroy()
    {
        FFMessage <ChangeLevelStateEvent> .Disconnect(OnChangeLevelStateEvent);

        FFMessage <GetIPAddressEvent> .Disconnect(OnGetIPAddressEvent);
    }
Ejemplo n.º 14
0
 void OnDestroy()
 {
     FFMessage <FFLocalEvents.TimeChangeEvent> .Disconnect(OnTimeChangeEvent);
 }
Ejemplo n.º 15
0
 private void OnDestroy()
 {
     FFMessage <PathFollowerCompletedLoopEvent> .Disconnect(DoThing);
 }
Ejemplo n.º 16
0
 private void OnDestroy()
 {
     FFMessage <FogMsg> .Disconnect(IncrementFogDensity);
 }
Ejemplo n.º 17
0
 private void OnDestroy()
 {
     FFMessage <UI_Text> .Disconnect(ChangeText);
 }