Пример #1
0
 public void GoChaseCar()
 {
     ParetTime.SetActive(false);
     timeCurrentDay.StopTimeDay();
     ParentFade.SetActive(true);
     StartCoroutine(FadeIn(1f, 2));
 }
Пример #2
0
    private IEnumerator FadeOut(float aValue)
    {
        var alpha = ImageFade.color.a;

        for (var t = 1.0f; t > 0f; t -= Time.deltaTime)
        {
            print(alpha);
            var newColor = new Color(0, 0, 0, Mathf.Lerp(aValue, alpha, t));
            ImageFade.color = newColor;
            yield return(null);
        }
        ParentFade.SetActive(false);
        if (CurrentFineCar >= MaxCountFineCar)
        {
            endLevel.CheckResult(MaxCountFineCar, CurrentFineCar, Mathf.FloorToInt(timeCurrentDay.TimeSeconds));
        }
    }
Пример #3
0
    public void GoFadeToCar(GameObject _GM_Car)
    {
        CurrentCar = _GM_Car;
        ParentFade.SetActive(true);
        int rand = Random.Range(0, 3);

        if (CurrentCar.GetComponent <MoveCar>().IsSpeedCar)
        {
            rand = 2;
            CurrentCar.GetComponent <MoveCar>().SpeedMove = 120f;
        }

        if (rand < 2)
        {
            if (CurrentCar.GetComponent <MoveCar>().IsTaskedCar)
            {
                StartCoroutine(FadeIn(1f, 0));
            }
            else
            {
                SetCarAndMan();
            }
        }
        else
        {
            if (CurrentCar.GetComponent <MoveCar>().IsTaskedCar)
            {
                CurrentCar.tag = "CurCar";
                CurrentCar.GetComponent <MoveCar>().IsTarget = true;
                CurrentCar.GetComponent <MoveCar>().EnableBoxCollider2();

                GoChaseCar();
            }
            else
            {
                SetCarAndMan();
            }
        }
    }
Пример #4
0
 public void GoFadeDefaulCam()
 {
     ParentFade.SetActive(true);
     StartCoroutine(FadeIn(1f, 1));
 }