void Start()
 {
     if (FFSystem.OwnGameObject(gameObject))
     {
         FFMessage <ChangeLevelStateEvent> .Connect(OnChangeLevelStateEvent);
     }
 }
    // Use this for initialization
    void Start()
    {
        // Setup handloers
        {
            foreach (Transform textobj in textObjectsRoot)
            {
                AddToHandler(textHandlers, textobj);
            }

            foreach (Transform iconobj in iconObjectsRoot)
            {
                AddToHandler(iconHandlers, iconobj);
            }

            foreach (Transform fullscreenobj in fullScreenObjectsRoot)
            {
                AddToHandler(fullScreenHandlers, fullscreenobj);
            }
        }

        { // listen to UI events
            FFMessage <ShowPlayerControlsEvent> .Connect(OnShowPlayerControlsEvent);

            FFMessage <ShowCustomTextMessage> .Connect(OnShowCustomTextMessage);

            FFMessage <ShowCustomIconMessage> .Connect(OnShowCustomIconMessage);
        }
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        // Initialize
        {
            FadeSequence = action.Sequence();
        }

        // Fade Sequence
        {
            FadeSequence.Property(
                ffSpriteColor,
                new Color(ffSpriteColor.Val.r, ffSpriteColor.Val.g, ffSpriteColor.Val.b, 0.0f),
                FFEase.E_SmoothStart,
                OpenFadeTime);

            FadeSequence.Sync();
            FadeSequence.Delay(PreFadeTime);
            FadeSequence.Sync();

            if (trigger == FadeTrigger.KeyPress)
            {
                InputUpdate();
            }
            else
            {
                FFMessage <TriggerFade> .Connect(OnTriggerFade);
            }
        }
    }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     // Connect to an Event, this also registers the event to
     // FFMessageSystem so that the event's behavior can be
     // Recorded.
     FFMessage <PlayerDiedEvent> .Connect(ReportPlayerDeath);
 }
Esempio n. 5
0
    public static void GetReady()
    {
        if (singleton == null)
        {
            GameObject newFFClient;
            newFFClient = new GameObject("FFClient");
            _singleton  = newFFClient.AddComponent <FFClient>();
            FFMessage <ClientConnectedEvent> .Connect(OnClientConnected);

            FFMessage <ClientSyncTimeEvent> .Connect(OnClientSyncTime);
        }
    }
Esempio n. 6
0
    void Awake()
    {
        if (this == singleton)
        {
            _clientWatch.Start();
            FFMessage <NetObjectCreatedEvent> .Connect(OnNetObjectCreatedEvent);

            FFMessage <NetObjectDestroyedEvent> .Connect(OnNetObjectDestroyedEvent);

            FFMessage <ClientConnectionReadyEvent> .Connect(OnClientConnectionReady);

            FFMessage <GameObjectNetIdRecievedEvent> .Connect(OnGameObjectNetIdRecieved);

            Debug.Log("FFSystem is awake!");

            FFLocalEvents.TimeChangeEvent TCE;
            TCE.newCurrentTime = FFSystem.time;
            FFMessage <FFLocalEvents.TimeChangeEvent> .SendToLocal(TCE);
        }
    }
Esempio n. 7
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);
        }
    }
Esempio n. 8
0
    // Use this for initialization
    void Start()
    {
        updateDialogSeq = action.Sequence();
        dialogSequence  = action.Sequence();

        // Add mapping to dictionary
        foreach (var mapping in OratorMapping)
        {
            if (mapping.name != OratorNames.None && mapping.trans != null)
            {
                Orators.Add(mapping.name, mapping.trans);
            }
        }

        // Add Dialogs
        {
            foreach (Transform child in transform)
            {
                var cd = child.GetComponent <CharacterDialog>();
                if (cd != null)
                {
                    AddCharacterDialog(cd);
                }
            }
        }

        // Listen to events
        FFMessage <EnterParty> .Connect(OnEnterParty);

        FFMessage <LeaveParty> .Connect(OnLeaveParty);

        FFMessage <EnterArea> .Connect(OnEnterArea);

        FFMessage <LeaveArea> .Connect(OnLeaveArea);

        // Start update of dialogs
        UpdateDialog();
    }
Esempio n. 9
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);
    }
Esempio n. 10
0
 void Start()
 {
     FFMessage <ChangeLevelStateEvent> .Connect(OnChangeLevelStateEvent);
 }
Esempio n. 11
0
 private void Start()
 {
     FFMessage <PathFollowerCompletedLoopEvent> .Connect(DoThing);
 }
Esempio n. 12
0
 // Use this for initialization
 void Start()
 {
     UI = GetComponent <Text>();
     FFMessage <MoneyStruct> .Connect(ChangeText);
 }
Esempio n. 13
0
 private void Awake()
 {
     FFMessage <UI_Text> .Connect(ChangeText);
 }
Esempio n. 14
0
 // Use this for initialization
 void Start()
 {
     FFMessage <PathFollowerCompletedLoopEvent> .Connect(LoopCompleted);
 }
Esempio n. 15
0
    void Start()
    {
        // Events
        FFMessage <ChangeLevelStateEvent> .Connect(OnChangeLevelStateEvent);

        FFMessage <GetIPAddressEvent> .Connect(OnGetIPAddressEvent);

        // Sequence
        DisconnectSequence = action.Sequence();

        // MenuUI
        if (InputField_PlayerName == null ||
            InputField_ServerIPAddress == null ||
            InputButton_StartNewServer == null ||
            InputButton_JoinServer == null ||
            TextField_IPAddresses == null ||
            TextField_Notice == null)
        {
            Debug.LogError("Error, ExLevelController is missing a refernce to a MenuUI object");
            return;
        }

        // GameUI
        if (InputButton_LeaveServer == null ||
            TextField_Wave == null ||
            TextField_PlayerNames == null)
        {
            Debug.LogError("Error, ExLevelController is missing a refernce to a GameUI object");
            return;
        }

        // Setup Text Input Events from UI
        // MenuUI
        _inputField_playerName      = InputField_PlayerName.GetComponent <InputField>();
        _inputField_serverIPAddress = InputField_ServerIPAddress.GetComponent <InputField>();
        _inputButton_startNewServer = InputButton_StartNewServer.GetComponent <Button>();
        _inputButton_joinServer     = InputButton_JoinServer.GetComponent <Button>();
        _inputButton_quitGame       = InputButton_QuitGame.GetComponent <Button>();
        _textField_iPAddresses      = TextField_IPAddresses.GetComponent <Text>();
        _textField_notice           = TextField_Notice.GetComponent <Text>();

        // GameUI
        _inputButton_leaveServer = InputButton_LeaveServer.GetComponent <Button>();
        _textField_wave          = TextField_Wave.GetComponent <Text>();
        _textField_playerNames   = TextField_PlayerNames.GetComponent <Text>();

        // ------------------- Connect to events -------------------------------

        // MenuUI
        _inputField_playerName.onEndEdit.AddListener(OnSubmitPlayerName);
        _inputField_serverIPAddress.onEndEdit.AddListener(OnSubmitServerIPAddress);
        _inputButton_startNewServer.onClick.AddListener(OnClickStartNewServer);
        _inputButton_joinServer.onClick.AddListener(OnClickJoinServer);
        _inputButton_quitGame.onClick.AddListener(OnClickQuitGame);

        // GameUI
        _inputButton_leaveServer.onClick.AddListener(OnClickLeaveServer);

        // Set Text fields

        FFClient.GetLocalIPEventStart();
        FFClient.GetPublicIPEventStart();

        // Set Level State
        ChangeLevelStateEvent CLSE;

        CLSE.newState = LevelState.In_Menu;
        FFMessage <ChangeLevelStateEvent> .SendToLocal(CLSE);
    }
Esempio n. 16
0
 void Awake()
 {
     FFMessage <FFLocalEvents.TimeChangeEvent> .Connect(OnTimeChangeEvent);
 }
Esempio n. 17
0
 private void Start()
 {
     DontDestroyOnLoad(gameObject);
     FFMessage <HelpedYou> .Connect(HelpedMeF);
 }
Esempio n. 18
0
 // Use this for initialization
 void Start()
 {
     // FFMessage is global which means that it is not sensative
     // to where it is called from
     FFMessage <PlayerDiedEvent> .Connect(OnPlayerDiedEvent);
 }
Esempio n. 19
0
 // Use this for initialization
 void Awake()
 {
     fog = GetComponent <UB.D2FogsPE>();
     FFMessage <FogMsg> .Connect(IncrementFogDensity);
 }