예제 #1
0
    IEnumerator GameOverSeq()
    {
        m_audio.StopAll();
        m_audio.PlayOneShot(m_seGameOver, 1.0f, 0);
        Hud.get().DrawGameOver(true);
        yield return(new WaitForSeconds(5.0f));

        UnityEngine.SceneManagement.SceneManager.LoadScene("TitleScene");
    }
예제 #2
0
    IEnumerator SwordAutoAttack()
    {
        m_gameCtrl.OnAttack();

        // 돌아본다.
        Vector3 target_pos = m_target.transform.position;

        target_pos.y = transform.position.y;
        transform.LookAt(target_pos);
        yield return(null);

        // 공격.
        m_animator.SetTrigger("begin_attack");
        yield return(new WaitForSeconds(0.3f));

        m_audio.PlayOneShot(m_swordAttackSE, 1.0f, 0.0f);
        yield return(new WaitForSeconds(0.2f));

        Vector3 projectilePos;

        projectilePos = transform.position + transform.forward * 0.5f;
        Instantiate(SWORD_ATTACK_OBJ, projectilePos, Quaternion.identity);
        yield return(null);

        // 공격 효과
        Object geteffect = Instantiate(GET_EFFECT, transform.position, Quaternion.identity);

        Destroy(geteffect, 1.0f);

        // 방향을 원래대로 되돌린다.
        Remove();
        m_gameCtrl.OnEndAttack();
    }
예제 #3
0
    IEnumerator SwordAutoAttack()
    {
        m_gameCtrl.OnAttack();

        // 回转
        Vector3 target_pos = m_target.transform.position;

        target_pos.y = transform.position.y;
        transform.LookAt(target_pos);
        yield return(null);

        // 攻击
        m_animator.SetTrigger("begin_attack");
        yield return(new WaitForSeconds(0.3f));

        m_audio.PlayOneShot(m_swordAttackSE, 1.0f, 0.0f);
        yield return(new WaitForSeconds(0.2f));

        Vector3 projectilePos;

        projectilePos = transform.position + transform.forward * 0.5f;
        Instantiate(SWORD_ATTACK_OBJ, projectilePos, Quaternion.identity);
        yield return(null);

        // 回到原来的方向
        Remove();
        m_gameCtrl.OnEndAttack();
    }
예제 #4
0
    // 初期化.
    void Start()
    {
        AudioChannels audio = FindObjectOfType(typeof(AudioChannels)) as AudioChannels;

        if (audio != null)
        {
            audio.PlayOneShot(m_SEAppear, 1.0f, 0.0f);
        }
        Destroy(gameObject, m_lifeTime);
    }
예제 #5
0
    IEnumerator AttackSub()
    {
        m_gameCtrl.OnAttack();
        transform.LookAt(m_attackTarget.position);
        yield return(null);

        m_animator.SetTrigger("begin_attack");
        m_audio.PlayOneShot(m_attackSE, 1.0f, 0.0f);
        yield return(new WaitForSeconds(0.5f));

        m_attackTarget.SendMessage("Damage");
        m_animator.SetTrigger("begin_idle");
        m_gameCtrl.OnEndAttack();
    }
예제 #6
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <PlayerController>() != null)
     {
         other.SendMessage("OnGetSword", 0);
         transform.localScale = new Vector3(0, 0, 0);
         AudioChannels audioChannels = FindObjectOfType(typeof(AudioChannels)) as AudioChannels;
         if (audioChannels != null)
         {
             audioChannels.PlayOneShot(GET_SE, 1, 0);
         }
         Object geteffect = Instantiate(GET_EFFECT, transform.position, Quaternion.identity);
         Destroy(geteffect, 1.0f);
         Destroy(gameObject);
     }
 }
예제 #7
0
    public void PickUpItem(Vector3 p)
    {
        int  gx, gz;
        bool ret = PositionToIndex(p, out gx, out gz);

        if (ret)
        {
            int idx = m_mapData.gemParticleIndex[gz, gx];
            if (idx >= 0)
            {
                Particle[] gemParticle = m_gemEmitter.particles;
                gemParticle[idx].size              = 0;
                m_gemEmitter.particles             = gemParticle;
                m_mapData.gemParticleIndex[gz, gx] = -1;
                m_audio.PlayOneShot(m_gemPickupSe, 1.0f, 0);
                Hud.get().AddScore(GEM_SCORE);
                m_gemCurrentNum--;
                if (m_gemCurrentNum <= 0)
                {
                    m_gameCtrl.OnEatAll();
                }
            }
        }
    }
예제 #8
0
 // 발소리 재생.
 public void     PlayStepSound(float float_param)
 {
     m_audio_channels.PlayOneShot(m_stepSE, 1.0f, 0.0f, float_param);
 }