示例#1
0
    public void Shoot()
    {
        MyDebug.Log("유닛1: 공격");
        //1 총알을 생성
        GameObject go    = Instantiate(arrowPrefab, arrowPoint.position, Quaternion.identity);
        Arrow_C    arrow = go.GetComponent <Arrow_C> ();

        myAudio.Play();

        //2 화살에게 타겟 정보를 보낸다
        arrow.TargetSetter(target);
        //GetFeverPoint();
    }
    public void Shoot()
    {
        MyDebug.Log("유닛2: 공격");
        //1 총알을 생성
        GameObject go = Instantiate(arrowPrefab, arrowPoint.position, Quaternion.identity);
        //애로우인데 어떤 애로우냐? 프리팹에 들어있는 애로우cs이다
        Arrow_C arrow = go.GetComponent <Arrow_C> ();

        //3 화살의 소리를 재생
        myAudio.Play();
        //2 화살에게 타겟 정보를 보낸다
        arrow.TargetSetter(target);
        GetFeverPoint();
    }
示例#3
0
    void Shoot()
    {
        //1 총알을 생성
        GameObject go = Instantiate(bulletPrefab, bulletPoint.position, Quaternion.identity);
        //애로우인데 어떤 애로우냐? 프리팹에 들어있는 애로우cs이다
        Arrow_C bullet = go.GetComponent <Arrow_C> ();

        //2 화살에게 타겟 정보를 보낸다

        myAudio.Play();

        bullet.TargetSetter(target);
        bullet.damage = myDmg;
        if (scoreManager != null)
        {
            scoreManager.fp += 20;
        }
    }