public override void Execute() { if (endedInstruction) { DialogueDatabase.activeGraphPlayer.ChangeNode(output.outputNode); return; } if (!_inAction) { var data = GetBackgrounds(DialogueDatabase.activeGraphPlayer.layer); switch (transition) { case EnumImageTransition.Instant: ParadoxImageTransition.Instante(data.background1, data.background2, locationBackground, this); break; case EnumImageTransition.Crossfade: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.Fade(data.background1, data.background2, locationBackground, this, timeDuration)); break; case EnumImageTransition.Slide_Down: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.SlideDown(data.background1, data.background2, locationBackground, this, timeDuration)); break; case EnumImageTransition.Slide_Up: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.SlideUp(data.background1, data.background2, locationBackground, this, timeDuration)); break; case EnumImageTransition.Slide_Left: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.SlideLeft(data.background1, data.background2, locationBackground, this, timeDuration)); break; case EnumImageTransition.Slide_Right: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.SlideRight(data.background1, data.background2, locationBackground, this, timeDuration)); break; case EnumImageTransition.Fade_Out_and_In: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.FadeOutAndIn(data.background1, data.background2, locationBackground, this, timeDuration)); break; } DialogueDatabase.activeGraphPlayer.layer = data.newLayer; _inAction = true; } }
public override void Execute() { if (endedInstruction) { DialogueDatabase.activeGraphPlayer.CharactersInScene[character] = _newCharaImg; DialogueDatabase.activeGraphPlayer.poolManager.DisposePoolObject("Character", _charaImg.gameObject); DialogueDatabase.activeGraphPlayer.ChangeNode(output.outputNode); return; } if (_inAction) { return; } if (!DialogueDatabase.activeGraphPlayer.CharactersInScene.ContainsKey(character)) { endedInstruction = true; Debug.LogWarning($"The character {character.name} is not in the scene"); return; } _charaImg = DialogueDatabase.activeGraphPlayer.TakeCharacterPool(character); _newCharaImg = DialogueDatabase.activeGraphPlayer.poolManager.GetPoolObject("Character").GetComponent <Image>(); _newCharaImg.rectTransform.anchoredPosition = _charaImg.rectTransform.anchoredPosition; _charaImg.CrossFadeAlpha(1, 0, false); _newCharaImg.CrossFadeAlpha(0, 0, false); switch (transition) { case EnumImageTransition.Instant: ParadoxImageTransition.Instante(_charaImg, _newCharaImg, sprite, this); break; case EnumImageTransition.Crossfade: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.Fade(_charaImg, _newCharaImg, sprite, this, timeDuration)); break; case EnumImageTransition.Fade_Out_and_In: DialogueDatabase.activeGraphPlayer.StartCoroutine(ParadoxImageTransition.FadeOutAndIn(_charaImg, _newCharaImg, sprite, this, timeDuration)); break; } _inAction = true; }