private void OnDestroy() { if (isLocalize) { PearlEventsManager.RemoveAction(ConstantStrings.SetNewLanguageEvent, SetSprite); } }
protected void OnDisable() { if (stopSoundInPause) { PearlEventsManager.RemoveAction <bool>(ConstantStrings.Pause, Pause); } }
private void UseHelpInputUI(bool value) { if (useHelpUIEvent) { PearlEventsManager.CallEvent(helpEvent, PearlEventType.Normal, value); } }
protected override void OnExecute() { if (pause != null) { PearlEventsManager.CallEvent(ConstantStrings.Pause, PearlEventType.Normal, pause.value); } EndAction(); }
protected override void Awake() { base.Awake(); PearlEventsManager.AddAction <InputDeviceEnum>(ConstantStrings.ChangeInputDevice, ChangeText); var manager = InputManager.Input; ChangeText(manager ? manager.CurrentInputDevice : InputDeviceEnum.Null); }
private void OnDestroy() { foreach (var info in triggerInfos) { if (_dictionaryAction.TryGetValue(info.ev, out Action action)) { PearlEventsManager.RemoveAction(info.ev, action); } } }
void Update() { Vector2 screenSize = new Vector2(Screen.width, Screen.height); if (this.lastScreenSize != screenSize) { this.lastScreenSize = screenSize; PearlEventsManager.CallEvent(ConstantStrings.ChangeResolution, PearlEventType.Normal); } }
protected override void OnExecute() { if (triggerEvents != null && triggerEvents.value.IsNotNull(out List <string> auxTriggerEvents)) { foreach (var trigger in auxTriggerEvents) { PearlEventsManager.ClearTrigger(trigger); } } EndAction(); }
protected override void Start() { base.Start(); ControlVersion(); TextManager.SetVariableString("gameName", gameName); StorageOptions.Load(this); PearlEventsManager.CallEvent(ConstantStrings.SetNewLanguageEvent, PearlEventType.Normal); }
private void OnDisable() { if (typeNumber == TypeNumber.Float) { PearlEventsManager.RemoveAction <float>(ev, WriteNumber); } else { PearlEventsManager.RemoveAction <int>(ev, WriteNumber); } }
private void Start() { if (isLocalize) { PearlEventsManager.AddAction(ConstantStrings.SetNewLanguageEvent, SetSprite); if (idSprite != string.Empty) { SetDictionary(); SetSprite(); } } }
protected override void OnDestroy() { base.OnDestroy(); PearlEventsManager.RemoveAction(ConstantStrings.Gameover, OnGameOver); PearlEventsManager.RemoveAction <bool>(ConstantStrings.Pause, CallPause); var input = InputManager.Input; if (input) { input.PerformedHandle(ConstantStrings.Pause, _functionPause, ActionEvent.Remove, StateButton.Down, pauseInputMap); } }
public void AddAction <T>(string constantStrings, Action <T> action, DeleteGameObjectEnum onDestroy, bool solo = false) { PearlEventsManager.AddAction(constantStrings, action, solo); if (onDestroy == DeleteGameObjectEnum.Destroy) { DestroyHandler += () => PearlEventsManager.RemoveAction(constantStrings, action); } else if (onDestroy == DeleteGameObjectEnum.Disable) { EnableHandler += (PearlBehaviour @this) => PearlEventsManager.AddAction(constantStrings, action); DisableHandler += (PearlBehaviour @this) => PearlEventsManager.RemoveAction(constantStrings, action); } }
protected override void Start() { base.Start(); _functionPause = () => CallPause(true); PearlEventsManager.AddAction(ConstantStrings.Gameover, OnGameOver); PearlEventsManager.AddAction <bool>(ConstantStrings.Pause, CallPause); var input = InputManager.Input; if (input) { input.PerformedHandle(ConstantStrings.Pause, _functionPause, ActionEvent.Add, StateButton.Down, pauseInputMap); } }
private void Start() { foreach (var info in triggerInfos) { Action action = () => { if (_dictionaryEvent.TryGetValue(info.ev, out UnityEvent unityEvent)) { unityEvent?.Invoke(); } }; _dictionaryAction.Add(info.ev, action); _dictionaryEvent.Add(info.ev, info.unityEvent); PearlEventsManager.AddAction(info.ev, action); } }
protected override void Awake() { base.Awake(); if (inputDataType == InputDataType.Image && imageComponent) { buttonImageForInputScriptableObjects = AssetManager.LoadAsset <ButtonImageForCommandScriptableObject[]>(buttonImageForInputSting); spriteManager = new SpriteManager(imageComponent); } if (inputDataType == InputDataType.Text && textComponent) { buttonTextForCommandScrptableObjecta = AssetManager.LoadAsset <ButtonTextForCommandScriptableObject[]>(buttonTextForInputSting); } PearlEventsManager.AddAction <InputDeviceEnum>(ConstantStrings.ChangeInputDevice, SetType); }
protected override void OnExecute() { if (eventEnum != null && eventType != null) { object parameters = null; if (useParameter != null && useParameter.value && parameter != null) { parameters = parameter.value.Get(); } if (wantReturn != null && wantReturn.value) { if (useParameter != null && useParameter.value) { PearlEventsManager.CallEventWithReturn(eventEnum.value, eventType.value, FinishAction, parameters); } else { PearlEventsManager.CallEventWithReturn(eventEnum.value, eventType.value, FinishAction); } } else { if (useParameter != null && useParameter.value) { PearlEventsManager.CallEvent(eventEnum.value, eventType.value, parameters); } else { PearlEventsManager.CallEvent(eventEnum.value, eventType.value); } EndAction(); } } else { EndAction(); } }
// Start is called before the first frame update protected void Awake() { PearlEventsManager.CallEvent("testTrigger", PearlEventType.Trigger, "testTrigger"); }
protected void Start() { PearlEventsManager.CallEvent("test", PearlEventType.Normal, "test"); PearlEventsManager.CallEventWithReturn("testWait", PearlEventType.Normal, OnFinishtestWait); }
protected void OnDisable() { PearlEventsManager.RemoveAction("testWait", OnTestWait); }
protected override void OnDisable() { PearlEventsManager.RemoveAction(eventName.value, OnFinish); }
// Start is called before the first frame update protected void Awake() { PearlEventsManager.AddAction("testWait", OnTestWait); }
protected override void OnDestroy() { base.OnDestroy(); PearlEventsManager.RemoveAction <InputDeviceEnum>(ConstantStrings.ChangeInputDevice, SetType); }
public void CallTriggerEvent(string ev) { PearlEventsManager.CallEvent(ev, PearlEventType.Normal); }
private void Awake() { PearlEventsManager.AddAction(ConstantStrings.SetNewLanguageEvent, SetText); }
protected override void OnEnable() { PearlEventsManager.AddAction(eventName.value, OnFinish); }
void Start() { PearlEventsManager.AddAction <float>(ConstantStrings.loadingLevel, ShowProgress); }
private void OnDisable() { PearlEventsManager.RemoveAction <float>(ev, UpdateTimer); }
private void OnDestroy() { PearlEventsManager.RemoveAction(ConstantStrings.SetNewLanguageEvent, SetText); }
protected override void OnDisable() { PearlEventsManager.RemoveAction(ConstantStrings.FinishLoadScene, OnFinish); }