/// <summary> /// Called when behaviour enters the Playing state. /// For instant-fire behaviours, this is where 99% of the logic will go. /// </summary> protected override void OnEnteredPlaying(TriggeredState prevState) { int theIndex = sceneIndex; switch (loadType) { case LoadType.Reload: theIndex = GetIndex_Reload(); break; case LoadType.LoadPrev: theIndex = GetIndex_LoadPrev(); break; case LoadType.LoadNext: theIndex = GetIndex_LoadNext(); break; case LoadType.LoadIndex: theIndex = GetIndex_LoadIndex(); break; } EventData_Gameplay theData = new EventData_Gameplay(); theData.SceneIndex = theIndex; GameManager.Events.Broadcast <EventType_Gameplay> ((int)EventType_Gameplay.SceneLoad, theData); // Called at end of this method for an instant-fire behaviour RequestComplete(); }
/// <summary> /// Called when behaviour enters the Playing state. /// For instant-fire behaviours, this is where 99% of the logic will go. /// </summary> protected override void OnEnteredPlaying(TriggeredState prevState) { EventData_Gameplay theData = new EventData_Gameplay(); theData.WalkSpeed = setWalkSpeed; switch (modType) { case ModType.Reset: OnEnteredPlaying_Reset(theData); break; case ModType.Set: OnEnteredPlaying_Set(theData); break; } // Called at end of this method for an instant-fire behaviour RequestComplete(); }
private void OnEnteredPlaying_Set(EventData_Gameplay theData) { GameManager.Events.Broadcast <EventType_Gameplay> ((int)EventType_Gameplay.SetPlayerWalkSpeed, theData); }
private void OnSetWalkSpeed(EventData_Gameplay theData) { SetWalkSpeed(theData.WalkSpeed); }
private void OnResetWalkSpeed(EventData_Gameplay theData) { ResetWalkSpeed(); }