Example #1
0
    void Update()
    {
        Moving();
        CheckIfPositionReached();



        if (InMenu == false && IncreaseFallingSpeed > -2)
        {
            Timer += Time.deltaTime;
            if (Timer > 10)
            {
                IncreaseFallingSpeed -= 0.2f;
                Timer = 0;
            }
        }

        if (Input.GetMouseButtonDown(0) && jump == false && InMenu == false)
        {
            if (AimAssisted == true)
            {
                foreach (Falling go in fallingThings)
                {
                    go.GetComponent <Falling>().AimAssist();
                }

                AimAssisted = false;
                AimAssist1.SetActive(false);
                AimAssist2.SetActive(false);
            }

            Jumping();
        }
    }
Example #2
0
    void CheckIfPositionReached()
    {
        if (transform.position == lTop.transform.position)
        {
            transform.eulerAngles = new Vector3(0, 0, -90);
            anim.SetInteger("Jump", 0);
            Invoke("NextTarget", 0.5f);
        }

        if (transform.position == lBottom.transform.position && isWaitingForInput == false)
        {
            NextTarget();
            Roof.NewRoof();
            isWaitingForInput = true;
            if (AimAssisted == true)
            {
                AimAssist2.SetActive(true);
            }
        }

        if (transform.position == rTop.transform.position)
        {
            transform.eulerAngles = new Vector3(0, 0, -90);
            anim.SetInteger("Jump", 0);
            Invoke("NextTarget", 0.5f);
        }

        if (transform.position == rBottom.transform.position && isWaitingForInput == false)
        {
            NextTarget();
            Roof.NewRoof();
            isWaitingForInput = true;
            if (AimAssisted == true)
            {
                AimAssist1.SetActive(true);
            }
        }
    }