// Use this for initialization
 void Start()
 {
     ASource = GetComponent <AudioSource>();
     Sfx     = GetComponent <Player_SFX>();
     anime   = GetComponent <Animator>();
     sword   = transform.GetChild(0).GetComponent <CircleCollider2D>();
 }
Beispiel #2
0
    void Start()
    {
        ASource = GetComponent <AudioSource>();
        Sfx     = GetComponent <Player_SFX>();
        anime   = GetComponent <Animator>();

        health = maxHealth;
    }
    // Use this for initialization
    void Start()
    {
        gm      = GameObject.FindObjectOfType <GameManager>();
        ASource = GetComponent <AudioSource>();
        Sfx     = GetComponent <Player_SFX>();

        //set the veriables that are kept in the game manager when this script is reloaded
        gm.hints         = 0;
        gm.coins         = 1000;
        gm.pieces        = 0;
        gm.currentALevel = 0;
        gm.currentHLevel = 0;
    }
Beispiel #4
0
    // Public Functions ---------------------------------

    // Player SFX를 재생하기 위한 함수
    public void PlayPSFX(Player_SFX pSFX, float volume = 1.0f)
    {
        playerSFX_SR.clip = dPlayerEffectClips[pSFX];

        if (pSFX == Player_SFX.Footstep2)
        {
            playerSFX_SR.pitch = 1.1f;
        }
        else
        {
            playerSFX_SR.pitch = (MasterVolume * 1.0f);
        }

        playerSFX_SR.volume = volume;
        playerSFX_SR.loop   = false;
        playerSFX_SR.Play();
    }