Ejemplo n.º 1
0
    IEnumerator CheckDistance()
    {
        yield return(null);

        float distance = 1000f;

        for (int i = 0; i < dangerObjectList.Count; i++)
        {
            if (!dangerObjectList[i].gameObject.active)
            {
                dangerObjectList.Remove(dangerObjectList[i]);
                i = 0;
                if (dangerObjectList.Count == 0)
                {
                    fadeDanger.Fade(0f, 0f);
                }
            }

            if (dangerObjectList.Count > 0)
            {
                Vector3 dangerObjPos = dangerObjectList[i].gameObject.transform.position;
                float   newDistance  = Vector3.Distance(dangerObjPos, transform.position);
                distance = distance > newDistance ? newDistance : distance;
            }
            else
            {
                distance = 10f;
            }
        }
        if (dangerObjectList.Count > 0)
        {
            fadeDanger.Fade(0.5f - distance * 0.1f, 0f);
        }
        StartCoroutine(CheckDistance());
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Debug.Log("GameManager가 둘이상입니다.");
        }

        fadeBlack.Fade(1f, 0f);

        //Events
        EventGameStart    += GameStart;
        EventGameOver     += GameOver;
        EventCollectTrial += CollectTrial;
    }
Ejemplo n.º 3
0
    IEnumerator CoGameOver(bool isWin)
    {
        yield return(null);

        Debug.Log("Game Over User Win : " + isWin);

        if (isWin)
        {
            fadeGood.Fade(0.5f, 0.5f);
        }
        else
        {
            fadeDanger.Fade(0.5f, 0.5f);
        }
        yield return(new WaitForSeconds(0.5f));

        fadeBlack.Fade(1f, 1f);
        yield return(new WaitForSeconds(2f));

        Application.LoadLevel(0);
    }
Ejemplo n.º 4
0
 void FadeOut(FadeCtrl pFade, float pTime)
 {
     pFade.Fade(1.0f, 0f, pTime);
 }
Ejemplo n.º 5
0
 void FadeIn(FadeCtrl pFade, float pTime)
 {
     pFade.Fade(0, 1.0f, pTime);
 }