Ejemplo n.º 1
0
 private void OnDestroy()
 {
     if (isLocalize)
     {
         PearlEventsManager.RemoveAction(ConstantStrings.SetNewLanguageEvent, SetSprite);
     }
 }
Ejemplo n.º 2
0
 protected void OnDisable()
 {
     if (stopSoundInPause)
     {
         PearlEventsManager.RemoveAction <bool>(ConstantStrings.Pause, Pause);
     }
 }
 private void UseHelpInputUI(bool value)
 {
     if (useHelpUIEvent)
     {
         PearlEventsManager.CallEvent(helpEvent, PearlEventType.Normal, value);
     }
 }
Ejemplo n.º 4
0
 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);
        }
Ejemplo n.º 6
0
 private void OnDestroy()
 {
     foreach (var info in triggerInfos)
     {
         if (_dictionaryAction.TryGetValue(info.ev, out Action action))
         {
             PearlEventsManager.RemoveAction(info.ev, action);
         }
     }
 }
Ejemplo n.º 7
0
    void Update()
    {
        Vector2 screenSize = new Vector2(Screen.width, Screen.height);

        if (this.lastScreenSize != screenSize)
        {
            this.lastScreenSize = screenSize;
            PearlEventsManager.CallEvent(ConstantStrings.ChangeResolution, PearlEventType.Normal);
        }
    }
Ejemplo n.º 8
0
 protected override void OnExecute()
 {
     if (triggerEvents != null && triggerEvents.value.IsNotNull(out List <string> auxTriggerEvents))
     {
         foreach (var trigger in auxTriggerEvents)
         {
             PearlEventsManager.ClearTrigger(trigger);
         }
     }
     EndAction();
 }
Ejemplo n.º 9
0
        protected override void Start()
        {
            base.Start();

            ControlVersion();

            TextManager.SetVariableString("gameName", gameName);

            StorageOptions.Load(this);
            PearlEventsManager.CallEvent(ConstantStrings.SetNewLanguageEvent, PearlEventType.Normal);
        }
Ejemplo n.º 10
0
 private void OnDisable()
 {
     if (typeNumber == TypeNumber.Float)
     {
         PearlEventsManager.RemoveAction <float>(ev, WriteNumber);
     }
     else
     {
         PearlEventsManager.RemoveAction <int>(ev, WriteNumber);
     }
 }
Ejemplo n.º 11
0
 private void Start()
 {
     if (isLocalize)
     {
         PearlEventsManager.AddAction(ConstantStrings.SetNewLanguageEvent, SetSprite);
         if (idSprite != string.Empty)
         {
             SetDictionary();
             SetSprite();
         }
     }
 }
Ejemplo n.º 12
0
        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);
            }
        }
Ejemplo n.º 13
0
        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);
            }
        }
Ejemplo n.º 14
0
        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);
            }
        }
Ejemplo n.º 15
0
 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);
     }
 }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
        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();
            }
        }
Ejemplo n.º 18
0
 // Start is called before the first frame update
 protected void Awake()
 {
     PearlEventsManager.CallEvent("testTrigger", PearlEventType.Trigger, "testTrigger");
 }
Ejemplo n.º 19
0
 protected void Start()
 {
     PearlEventsManager.CallEvent("test", PearlEventType.Normal, "test");
     PearlEventsManager.CallEventWithReturn("testWait", PearlEventType.Normal, OnFinishtestWait);
 }
Ejemplo n.º 20
0
 protected void OnDisable()
 {
     PearlEventsManager.RemoveAction("testWait", OnTestWait);
 }
Ejemplo n.º 21
0
 protected override void OnDisable()
 {
     PearlEventsManager.RemoveAction(eventName.value, OnFinish);
 }
Ejemplo n.º 22
0
 // Start is called before the first frame update
 protected void Awake()
 {
     PearlEventsManager.AddAction("testWait", OnTestWait);
 }
Ejemplo n.º 23
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     PearlEventsManager.RemoveAction <InputDeviceEnum>(ConstantStrings.ChangeInputDevice, SetType);
 }
Ejemplo n.º 24
0
 public void CallTriggerEvent(string ev)
 {
     PearlEventsManager.CallEvent(ev, PearlEventType.Normal);
 }
 private void Awake()
 {
     PearlEventsManager.AddAction(ConstantStrings.SetNewLanguageEvent, SetText);
 }
Ejemplo n.º 26
0
 protected override void OnEnable()
 {
     PearlEventsManager.AddAction(eventName.value, OnFinish);
 }
Ejemplo n.º 27
0
 void Start()
 {
     PearlEventsManager.AddAction <float>(ConstantStrings.loadingLevel, ShowProgress);
 }
Ejemplo n.º 28
0
 private void OnDisable()
 {
     PearlEventsManager.RemoveAction <float>(ev, UpdateTimer);
 }
 private void OnDestroy()
 {
     PearlEventsManager.RemoveAction(ConstantStrings.SetNewLanguageEvent, SetText);
 }
Ejemplo n.º 30
0
 protected override void OnDisable()
 {
     PearlEventsManager.RemoveAction(ConstantStrings.FinishLoadScene, OnFinish);
 }