Ejemplo n.º 1
0
    void Update()
    {
        verifyLoad();

        if (startTime < transitionTime)
        {
            if (ApplyOnce.alreadyApplied("Reload", gameObject))
            {
                UpdateCircleConstricting();
                UpdateHalo();
                startTime--;
                if (startTime < 0)
                {
                    startTime = 0;
                    ApplyOnce.remove("Reload", gameObject);
                }
                ApplyOnce.apply("ChangeMode", gameObject, () => {
                    UIManager.GetInstance().ChangeMode(UIManager.Mode.NORMAL);
                    return(true);
                });
            }
            else
            {
                if (startTime == 0)
                {
                    UpdateLoadPoints();
                }
                UpdateCircleSimplified();
                startTime++;
                UpdateHalo();
            }

            if (startTime >= transitionTime)
            {
                ApplyOnce.apply("notifyAsderek", gameObject, () =>
                {
                    playerScript.ReceiveNotification(Asderek.Notification.Return);
                    warpImage      = null;
                    Time.timeScale = manager.chosenTime;
                    gameLoaded     = true;
                    ApplyOnce.remove("ChangeMode", gameObject);
                    return(true);
                });
            }
        }
    }
    protected override void HandleEdge()
    {
        if ((steps[steps.Count - 1].position.x - steps[steps.Count - 2].position.x) > 0)
        {
            player.gameObject.transform.eulerAngles = new Vector2(0, 0);
            //vira asderek pra direita
        }
        else
        {
            player.gameObject.transform.eulerAngles = new Vector2(0, 180);
        }

        player.ReceiveNotification(Asderek.Notification.Return);



        GameObject obj = player.gameObject;

        while (obj.transform.parent != transform && (obj.transform.parent != null))
        {
            obj = obj.transform.parent.gameObject;
        }
        obj.transform.parent = null;

        player = null;


        if (currentStep <= 0)
        {
            currentStep        = steps.Count - 1;
            transform.position = steps[steps.Count - 1].position;
        }
        else if (currentStep >= steps.Count)
        {
            currentStep        = 0;
            transform.position = steps[0].position;
        }
    }