Example #1
0
    // Use this for initialization
    void Start()
    {
        //bgm
        bgms             = GameObject.FindGameObjectWithTag("MainCamera").GetComponents <AudioSource>();
        PlatformerBgm    = bgms[1];
        ChaseBgm         = bgms[2];
        EndingBgm        = bgms[3];
        RemoveHeartSound = bgms[4];
        gameoverBgm      = bgms[5];
        savePointBgm     = bgms[6];

        scoreText.text = "Coin   x " + coinScore.ToString();
        instance       = this;
        player         = GameObject.FindGameObjectWithTag("Player");
        playerScript   = player.GetComponent <PlayerMove_refine>();
        playerTrans    = player.GetComponent <Transform>();
        playerAudio    = player.GetComponent <AudioSource>();
        savePoint      = player.GetComponent <SavePoint>();
        fadeScript     = fadeEffectUI.transform.GetChild(1).gameObject.GetComponent <FadeEffect>();

        // FadeIn 캐싱
        fadeIn = fadeEffectUI.transform.GetChild(0).gameObject;
        // FadeIn 실행
        fadeIn.SetActive(true);
        fadeEffectUI.transform.GetChild(0).GetComponent <FadeEffect>().StartFade();

        //for gameover
        startPosition = player.GetComponent <Transform>().position;

        //Packman Control
        packmanControl = GameObject.Find("PackmanManager").GetComponent <PackmanControl>();
        chasePackman   = GameObject.Find("CollisionBox").GetComponent <ChasePackman>();
    }
    // Use this for initialization
    void Start()
    {
        Cursor.visible = false;
        chasePackman   = transform.Find("CollisionBox").GetComponent <ChasePackman>();


        left  = new Vector3(0, -90, 0);
        right = new Vector3(0, 90, 0);

        firstPos = transform.position;
        firstRot = transform.rotation.eulerAngles;
    }