Exemplo n.º 1
0
    public void PlayBGM()
    {
        source.Stop();

        source.cueSheet = "Common/BGM";
        source.cueName  = "bgm0";

        source.Play();
    }
Exemplo n.º 2
0
 public void PlaySE(SEName cueName)
 {
     //Timerが鳴っていたら止める
     if (currentSeIndex == 20)
     {
         seSource.Stop();
     }
     currentSeIndex = (int)cueName;
     seSource.Play(currentSeIndex);
 }
Exemplo n.º 3
0
 public void StopVoice()
 {
     if (voiceSource != null)
     {
         voiceSource.Stop();
     }
 }
Exemplo n.º 4
0
    void FixedUpdate()
    {
        //HP減ったときに何かするってなったらここいじってくれればおk
        if (hitCount >= HP1)
        {
            //stickFlagがtrueになるとstickEのスクリプトを活性化
            stickFlag = true;
        }
        else if (hitCount == HP2)
        {
            //第2段階に入る処理とかはここ。
        }

        if (stickFlag == true)
        {
            donguri.GetComponent <StickE5>().enabled = true;
            Enemy.Play();
            rotate.SpeedUp();
            if (counter)
            {
                counter.GetComponent <EneDestCount>().count--;
            }
            donguri.GetComponent <EnemyPunch>().enabled         = false;
            donguri.GetComponent <NavMeshAgent>().enabled       = false;
            donguri.GetComponentInChildren <Animator>().enabled = false;
            donguri.GetComponent <MeshCollider>().enabled       = false;
            Burn.SetActive(false);
            Burning.Stop();
            stickFlag = false;
            Destroy(WallCheck);
            Destroy(this);
            hitCount++;
        }
    }
Exemplo n.º 5
0
 private void OnCollisionEnter2D(Collision2D other)
 {
     //地面と接触したときにSEを止める
     if (other.gameObject.CompareTag("Ground"))
     {
         _fallSE.Stop();
     }
 }
Exemplo n.º 6
0
    static public void PlayOrStop(GameObject soundObj)
    {
        CriAtomSource atomSource = soundObj.GetComponent <CriAtomSource>();

        if (atomSource.status == CriAtomSource.Status.Playing)
        {
            atomSource.Stop();
        }
        else if (atomSource.status == CriAtomSource.Status.Stop)
        {
            atomSource.Play();
        }
    }
Exemplo n.º 7
0
 public void PlayAndStopSound()
 {
     if (atomSrc != null)
     {
         CriAtomSource.Status status = atomSrc.status;
         if ((status == CriAtomSource.Status.Stop) || (status == CriAtomSource.Status.PlayEnd))
         {
             atomSrc.Play();
         }
         else
         {
             atomSrc.Stop();
         }
     }
 }
Exemplo n.º 8
0
 public void PlayAndStopSound()
 {
     if (atomSrc != null)
     {
         /* CriAtomSource の状態を取得 */
         CriAtomSource.Status status = atomSrc.status;
         if ((status == CriAtomSource.Status.Stop) || (status == CriAtomSource.Status.PlayEnd))
         {
             /* 停止状態なので再生 */
             atomSrc.Play();
         }
         else
         {
             /* 再生中なので停止 */
             atomSrc.Stop();
         }
     }
 }
Exemplo n.º 9
0
        public override void OnGraphStop(Playable playable)
        {
            base.OnGraphStop(playable);

            if (IsEditor)
            {
                if (CriAtomTimelinePreviewer.IsInitialized)
                {
                    CriAtomTimelinePreviewer.Instance.StopAllTracks();
                }
            }
            else
            {
                if (m_Bind != null)
                {
                    m_Bind.Stop();
                }
            }
            m_lastDirectorTime = 0;
        }
Exemplo n.º 10
0
 // Update is called once per frame
 void Update()
 {
     if (_sourceStart)
     {
         _source.volume += upVolume;
         if (_source.volume >= maxVolume)
         {
             _source.volume = maxVolume;
         }
     }
     else if (_sourceStart == false)
     {
         _source.volume -= 0.005f;
         if (_source.volume <= 0.0f)
         {
             _source.volume = 0.0f;
             _source.Stop();
         }
     }
 }
Exemplo n.º 11
0
 public void StopSE()
 {
     m_seSource.Stop();
 }
 public void PlayBgm(long value)
 {
     bgmSource.player.SetStartTime(value);
     bgmSource.Stop();
     PlayBgm();
 }
Exemplo n.º 13
0
 public void PlayBGM(BGMName cueName)
 {
     bgmSource.Stop();
     bgmSource.Play((int)cueName);
 }
 /// <summary>
 /// SEを停止する
 /// </summary>
 public void StopSE()
 {
     soundEffectPlayer.Stop();
 }
 /// <summary>
 /// BGMを停止する
 /// </summary>
 public void StopBGM()
 {
     bgmPlayer.Stop();
 }
Exemplo n.º 16
0
    // Update is called once per frame
    void Update()
    {
        //Windがアクティブ化したときにSEを鳴らす
        if (Wind.activeInHierarchy && _sourcePlay == false)
        {
            _source.Play();
            _sourcePlay = true;
        }
        else if (Wind.activeInHierarchy == false && _sourcePlay)
        {
            _source.Stop();
            _sourcePlay    = false;
            _source.volume = _sourceVolume;
        }

        if (_source.volume > _sourceVolume)
        {
            _source.volume = _sourceVolume;
        }

        //minusCountがtrueの時、1秒ごとにカウントを-1
        if (gameController.isPress == false && count > 0 && minusCount)
        {
            timer += Time.deltaTime;

            if (timer > 1)
            {
                if (_sourcePlay)
                {
                    _source.volume -= 0.2f;
                }
                timer = 0.0f;
                count--;
            }
        }

        //カウントが10を超えたら風を出現させる
        if (count >= _maxCount)
        {
            Wind.SetActive(true);
            fixedCount = true;
        }
        else if (count == 0)
        {
            Wind.SetActive(false);
            fixedCount = false;
        }

        //風が出ているときに歯車を回すと風のSEの音量を上げる
        if (minusCount == false && fixedCount)
        {
            _source.volume += 0.01f;

            if (_source.volume > _sourceVolume)
            {
                _source.volume = _sourceVolume;
            }
        }

        //limitCountを超えたらカウントストップ
        if (count >= _maxCount)
        {
            count = _maxCount;
        }
    }
 public void Stop()
 {
     source.Stop();
 }
Exemplo n.º 18
0
 void BossTackleSoundStop()
 {
     tacklesound.Stop();
 }
Exemplo n.º 19
0
 protected override bool StopInternal()
 {
     atomSource_.Stop();
     return(true);
 }
Exemplo n.º 20
0
    // Update is called once per frame
    void Update()
    {
        bool isAttack = animator.GetCurrentAnimatorStateInfo(0).IsName("Base Layer.Stamp");
        bool isWait   = animator.GetCurrentAnimatorStateInfo(0).IsName("Base Layer.Wait");
        bool IsBreath = animator.GetCurrentAnimatorStateInfo(0).IsName("Base Layer.Breath");

        Vector3 Ppos = new Vector3(target.position.x, 0.0f, target.position.z);
        Vector3 Epos = new Vector3(transform.position.x, 0.0f, transform.position.z);

        dist = Mathf.Sqrt(Mathf.Pow(Ppos.x - Epos.x, 2) + Mathf.Pow(Ppos.z - Epos.z, 2));

        if (!timeSet)
        {
            timecount += Time.deltaTime;
        }

        if (timecount >= AttackSelectTime)
        {
            //1の場合足踏み攻撃(Stamp),2の場合ブレス攻撃(Breath),3の場合突進攻撃(Tackle)
            //selectAttack = Random.Range(1, 4);
            //selectAttack = 2;
            timecount = 0;
            timeSet   = true;
            if (dist <= stopDist)
            {
                selectAttack = 1;
            }
            else if (dist <= BreathDist)
            {
                //ブレス攻撃を実行するかどうか
                bool attackflag = changeAttack(50);

                if (attackflag)
                {
                    selectAttack = 0;
                    timecount    = 0;
                    timeSet      = false;
                }
                else
                {
                    selectAttack = 2;
                }
            }
            else
            {
                //突進攻撃を実行するかどうか
                bool attackflag = changeAttack(60);

                if (attackflag == true)
                {
                    selectAttack = 0;
                    timecount    = 0;
                    timeSet      = false;
                }
                else
                {
                    selectAttack = 3;
                }
            }
        }

        //行動を選択するまでの時間の行動
        if (selectAttack == 0)
        {
            if (target != null && agent.enabled)
            {
                agent.destination = target.position;
                agent.speed       = Speed;

                /*経路探索を終了するstoppingDistanceとアニメーションを遷移させるstopDistが同じ値だと
                 *  不具合があったので、-0.3fした距離を設定*/
                agent.stoppingDistance = stopDist - 0.3f;
            }

            if (dist <= stopDist)
            {
                //Wait
                agent.enabled = false;
                this.animator.SetBool(walkStr, false);
            }
            else
            {
                //Walk
                agent.enabled = true;
                this.animator.SetBool(walkStr, true);
            }
        }

        if (startStampflag == true)
        {
            if (isAttack == true)
            {
                startStamp = true;
            }
            else
            {
                if (startStamp == true)
                {
                    this.animator.SetBool(stampStr, false);
                    timeSet        = false;
                    selectAttack   = 0;
                    startStampflag = false;
                    startStamp     = false;
                }
            }
        }

        //Stamp攻撃
        if (selectAttack == 1)
        {
            if (target != null && agent.enabled)
            {
                agent.destination = target.position;
                agent.speed       = Speed;

                /*経路探索を終了するstoppingDistanceとアニメーションを遷移させるstopDistが同じ値だと
                 *  不具合があったので、-0.3fした距離を設定*/
                agent.stoppingDistance = stopDist - 0.3f;
            }

            if (!startStampflag)
            {
                if (dist <= stopDist)
                {
                    agent.enabled = false;
                    //obstacle.enabled = true;

                    //Waitモーション時にプレイヤーの方を向かせる
                    if (isWait)
                    {
                        float      speed    = 0.03f;
                        Vector3    vec      = target.position - transform.position;
                        Vector3    nvec     = new Vector3(vec.x, transform.position.y, vec.z);
                        Quaternion rotation = Quaternion.LookRotation(nvec);
                        transform.rotation = Quaternion.Slerp(this.transform.rotation, rotation, speed);
                        //transform.LookAt(nvec);
                        Vector3 enemyVec = transform.eulerAngles;
                        enemyVec.x = 0.0f;
                        enemyVec.z = 0.0f;

                        transform.eulerAngles = enemyVec;
                        setVec = true;
                    }

                    this.animator.SetBool(walkStr, false);
                    this.animator.SetBool(stampStr, true);

                    startStampflag = true;
                }
                else
                {
                    this.animator.SetBool(stampStr, false);

                    if (!isAttack)
                    {
                        agent.enabled = true;
                        //obstacle.enabled = false;

                        this.animator.SetBool(walkStr, true);
                    }
                }
            }
        }

        //Breath攻撃
        if (selectAttack == 2)
        {
            agent.enabled = false;
            this.animator.SetBool(walkStr, false);
            this.animator.SetBool(breathStr, true);

            //ブレス攻撃が始まるまでのボスの向きを変更
            if (!startBreath)
            {
                float      speed    = 0.03f;
                Vector3    vec      = target.position - transform.position;
                Vector3    nvec     = new Vector3(vec.x, transform.position.y, vec.z);
                Quaternion rotation = Quaternion.LookRotation(nvec);
                transform.rotation = Quaternion.Slerp(this.transform.rotation, rotation, speed);

                Vector3 enemyVec = transform.eulerAngles;
                enemyVec.x = 0.0f;
                enemyVec.z = 0.0f;

                transform.eulerAngles = enemyVec;
            }

            if (bossanim.IsBreath)
            {
                if (!startBreath)
                {
                    particle.Play();
                    stopBreath = false;
                }

                startBreath = true;
            }

            if (startBreath && !IsBreath)
            {
                this.animator.SetBool(breathStr, false);
                particle.Stop();
                stopBreath   = true;
                BafterCount += Time.deltaTime;
            }

            if (BafterCount >= 1)
            {
                selectAttack = 0;
                timeSet      = false;
                startBreath  = false;
                BafterCount  = 0;
            }

            /*if (bossanim.stopBreath)
             * {
             *  particle.Stop();
             * }*/


            /*if (bossanim.finishBreath)
             * {
             *  this.animator.SetBool(breathStr, false);
             *  selectAttack = 0;
             *  timeSet = false;
             *  startBreath = false;
             * }*/
        }

        //Tackle攻撃
        if (selectAttack == 3)
        {
            agent.enabled     = false;
            startTackleCount += Time.deltaTime;

            if (startTackleCount >= TstartTime)
            {
                startTackle = true;
            }
            else
            {
                this.animator.SetBool(walkStr, false);
                startTackle = false;

                float      speed    = 0.03f;
                Vector3    vec      = target.position - transform.position;
                Vector3    nvec     = new Vector3(vec.x, transform.position.y, vec.z);
                Quaternion rotation = Quaternion.LookRotation(nvec);
                transform.rotation = Quaternion.Slerp(this.transform.rotation, rotation, speed);

                Vector3 enemyVec = transform.eulerAngles;
                enemyVec.x = 0.0f;
                enemyVec.z = 0.0f;

                transform.eulerAngles = enemyVec;
            }

            if (startTackle)
            {
                if (wallcheck.touchWall)
                {
                    isTackle = false;
                    tparticle.Stop();
                    Tackle.Stop();
                    rb.velocity = Vector3.zero;
                    stunCount  += Time.deltaTime;
                    this.animator.SetBool(tackleStr, false);

                    if (stunCount >= TstunTime)
                    {
                        stunCount        = 0;
                        rb.constraints   = RigidbodyConstraints.None;
                        rb.isKinematic   = true;
                        startTackle      = false;
                        Tspeed           = TSetSpeed;
                        selectAttack     = 0;
                        startTackleCount = 0;
                        timeSet          = false;
                    }
                }
                else
                {
                    this.animator.SetBool(walkStr, false);
                    this.animator.SetBool(tackleStr, true);
                    rb.isKinematic = false;
                    rb.constraints = RigidbodyConstraints.FreezeRotation;

                    Tspeed     += TAddSpeed;
                    Tspeed      = Mathf.Clamp(Tspeed, 0, TMaxSpeed);
                    rb.velocity = Vector3.zero;
                    rb.velocity = transform.forward * Tspeed;
                    if (!isTackle)
                    {
                        Tackle.Play();
                        tparticle.Play();
                        isTackle = true;
                    }
                }
            }
        }
    }
Exemplo n.º 21
0
 public void StopBGM()
 {
     m_bgmSource.Stop();
 }