示例#1
0
    public override void StartTransition(Room fromRoom, Room toRoom, RoomTransitionPoint transitionPoint)
    {
        IsDone      = false;
        _flip       = false;
        _fadeTarget = GameObject.Find("FadeTarget").GetComponent <Image>();

        base.StartTransition(fromRoom, toRoom, transitionPoint);
    }
示例#2
0
    public override void StartTransition(Room fromRoom, Room toRoom, RoomTransitionPoint transitionPoint)
    {
        _slideTarget = GameObject.Find("SlideTarget").GetComponent <RectTransform>();
        _slideTarget.anchoredPosition = new Vector2(800, 0);

        _slideImage = _slideTarget.GetComponent <Image>();

        if (ImageOverride != null)
        {
            _slideImage.sprite = ImageOverride;
        }

        _slideImage.color = new Color(0, 0, 0, 0);

        base.StartTransition(fromRoom, toRoom, transitionPoint);
    }
示例#3
0
    private IEnumerator DoTransition(Room fromRoom, RoomTransitionPoint transitionPoint)
    {
        _transitionState = TransitionState.Exiting;
        transitionPoint.LinkedRoom._transitionState = TransitionState.Entering;

        transitionPoint.TransitionBehavior.StartTransition(fromRoom, transitionPoint.LinkedRoom, transitionPoint);

        while (!transitionPoint.TransitionBehavior.IsDone)
        {
            transitionPoint.TransitionBehavior.Tick();
            yield return(new WaitForEndOfFrame());
        }

        transitionPoint.TransitionBehavior.EndTransition();

        _transitionState = TransitionState.None;
        transitionPoint.LinkedRoom._transitionState = TransitionState.Within;
    }
示例#4
0
    public virtual void StartTransition(Room fromRoom, Room toRoom, RoomTransitionPoint transitionPoint)
    {
        IsDone          = false;
        FromRoom        = fromRoom;
        ToRoom          = toRoom;
        TransitionPoint = transitionPoint;

        UIController.CancelAndClearDialog();

        LeanTween.value(FromRoom.gameObject, update =>
        {
            Time.timeScale      = update;
            Time.fixedDeltaTime = update * 0.02f;
        }, 1, 0, 0.5f)
        .setEase(LeanTweenType.easeOutExpo)
        .setIgnoreTimeScale(true)
        .setOnComplete(() => _startTransition = true);
    }
 void OnEnable()
 {
     script = target as RoomTransitionPoint;
 }
示例#6
0
 public void TriggerTransition(RoomTransitionPoint point)
 {
     StartCoroutine(DoTransition(this, point));
 }
 void OnEnable()
 {
     script = target as RoomTransitionPoint;
 }