Esempio n. 1
0
    public override void SendToLocalGameObject(FFBasePacket package, GameObject go)
    {
        FFPacket <EventType> sentPackage = (FFPacket <EventType>)package;

        FFPacket <EventType> .Decrypt(ref sentPackage.message);

        switch (package.packetInstructions)
        {
        case FFPacketInstructionFlags.MessageBoardGameObjectSend:
            FFMessageBoard <EventType> .SendToLocal(sentPackage.message, go);

            break;

        case FFPacketInstructionFlags.MessageBoardGameObjectSendDown:
            FFMessageBoard <EventType> .SendToLocalDown(sentPackage.message, go);

            break;

        case FFPacketInstructionFlags.MessageBoardGameObjectSendUp:
            FFMessageBoard <EventType> .SendToLocalUp(sentPackage.message, go);

            break;

        case FFPacketInstructionFlags.MessageBoardGameObjectSendToAllConnected:
            FFMessageBoard <EventType> .SendToLocalToAllConnected(sentPackage.message, go);

            break;

        default:
            break;
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))  // Activator Triggered
        {
            // for ExEnemies 1/2
            ActivateEnemiesEvent e;
            e.timeTakenToActivate = Time.realtimeSinceStartup;
            Activator.SendToLocal(e);

            // for ExEnemies 3
            FFMessageBoard <ActivateEnemiesEvent> .SendToLocalDown(e, gameObject);
        }

        if (Input.GetKeyDown(KeyCode.D))  // Deactivator Triggered
        {
            // for ExEnemies 1/2
            DeactivateEnemiesEvent e;
            e.timeTakenToDeactivate = Time.realtimeSinceStartup;
            Deactivator.SendToLocal(e);

            // for ExEnemies 3
            FFMessageBoard <DeactivateEnemiesEvent> .SendToLocalDown(e, gameObject);
        }
    }