コード例 #1
0
    void Awake()
    {
        foreach (var group in damageGroups)
        {
            damageGroup |= group;
        }

        FFSystem.RegisterNetGameObject(gameObject, gameObject.name);
        FFMessageBoard <ApplyHealthEvent> .Connect(OnApplyHealth, gameObject);

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

        if (FFServer.isLocal == false)
        {
            FFMessageBoard <ExHealth> .Connect(OnServerUpdate, gameObject);
        }
        else
        {
            FFMessage <FFNetEvents.ClientConnectedEvent> .Connect(OnClientConnected);
        }
    }
コード例 #2
0
    void Awake()
    {
        bool localNetObject = FFSystem.RegisterNetGameObject(gameObject, "Player");

        // Make Sequences
        MoveSeq = action.Sequence();
        // Update Sequence

        // Input Events only if object was created by local source
        if (localNetObject)
        {
            FFMessage <FFLocalEvents.UpdateEvent> .Connect(OnUpdateEvent);

            PositionUpdateSeq = action.Sequence();
            PositionUpdateSeq.Call(UpdatePositionCall);
        }

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

        FFMessageBoard <ExPlayerMoveAction> .Connect(OnPlayerMoveAction, gameObject);

        FFMessageBoard <ExPlayerFireAction> .Connect(OnPlayerFireAction, gameObject);
    }