예제 #1
0
파일: Truck.cs 프로젝트: MSyun/CLASH_ESCAPE
        /// <summary>
        /// 前方へ進む
        /// </summary>
        void Driving()
        {
            float time;

            // 時間計測
            m_fChaseTime += Time.deltaTime;

            switch (m_MoveType)
            {
            // 通常
            case _MoveType.TYPE_NONE:
                // 加速度
                time = m_Timer.GameTime * m_fAccelerate [m_nNowLevel];
                m_Mover.LocalMove((m_fSpeed [m_nNowLevel] + time) * Time.deltaTime);

                // 並走距離の確認
                if (m_fChaseBeginTime <= m_Timer.GameTime)
                {
                    m_MoveType   = CheckTargetDist();
                    m_fChaseTime = 0.0f;

                    if (m_MoveType != _MoveType.TYPE_NONE)
                    {
                        SoundManager.Instance.RePlaySE(0);
                    }
                }
                break;

            // 並走中
            case _MoveType.TYPE_CHASE:
                m_Mover.LocalMove(m_Target.DashSpeedMax * Time.deltaTime);

                FanSound();

                if (m_fChaseTime >= m_fChaseMaxTime)
                {
                    m_MoveType   = _MoveType.TYPE_CHASEEND;
                    m_fChaseTime = 0;
                }
                break;

            // 並走終了
            case _MoveType.TYPE_CHASEEND:
                // 加速度
                time = m_fChaseTime * m_fAccelerate[m_nNowLevel];
                m_Mover.LocalMove((m_Target.DashSpeedMax + time) * Time.deltaTime);
                break;
            }
            ;
        }
예제 #2
0
 /// <summary>
 /// 前方へ移動
 /// </summary>
 void ForwardMove()
 {
     // 移動中
     if (m_bMove && !m_bRush)
     {
         m_Mover.LocalMove(m_fMoveSpeed[m_nCurLevel] * Time.deltaTime);
     }
     else
     // 突進中
     if (m_bMove && m_bRush)
     {
         m_Mover.LocalMove(m_fRushSpeed[m_nCurLevel] * Time.deltaTime);
         JumpMove();
     }
 }
예제 #3
0
        /// <summary>
        /// クリア後の行動
        /// </summary>
        public void ClearMove()
        {
            m_fAfterTime += Time.deltaTime;

            if (m_fAfterTime >= 8.0f)
            {
                Destroy(this);
            }

            m_Move.LocalMove(DashSpeed * Time.deltaTime);

            if (m_bJumpAnim)
            {
                JumpMove();
            }
        }
예제 #4
0
파일: Car.cs 프로젝트: MSyun/CLASH_ESCAPE
        /// <summary>
        /// 更新
        /// </summary>
        void Update()
        {
            // 距離算出
            float Dist = Vector3.Distance(m_Player.transform.position, this.transform.position);

            // 警告
            Caution(Dist);

            // 攻撃判定
            if (!m_bAttack && Dist <= m_fAttackDist)
            {
                m_bAttack = true;
                gameObject.GetComponent <DeleteObstacle> ().enabled = true;
            }

            // 攻撃確認
            if (!m_bAttack)
            {
                return;
            }

            // X移動
            m_Mover.LocalMove(m_fMoveSpeed[m_nCurLevel] * Time.deltaTime);

            // ジャンプ
            m_fTime += Time.deltaTime;
            Vector3 pos = transform.position;

            pos.y  = m_fV0[m_nCurLevel] * m_fTime - (1.0f / 2.0f * m_fGravity * (m_fTime * m_fTime));
            pos.y += m_fInitHeight;
            transform.position = pos;
        }
예제 #5
0
        /// <summary>
        /// 更新
        /// </summary>
        void Update()
        {
            m_fTime += Time.deltaTime;

            if (m_fTime <= m_fStopTime)
            {
                m_Mover.LocalMove(m_fSpeed * Time.deltaTime);
            }

            if (!m_bObjComponent && m_fTime >= m_fObjMoveTime)
            {
                if (m_bNearGoal)
                {
                    Vector3 pos = Camera.main.transform.position;
                    pos.z = m_BringObj.transform.position.z;
                    Camera.main.transform.position = pos;
                    Camera.main.transform.LookAt(m_BringObj.transform);
                }
                else
                {
                    m_BringObj.GetComponent <SmashObj>().enabled = true;
                }
                m_bObjComponent = true;
            }

            // プレイヤーを倒す
            if (m_fTime < 1.0f)
            {
                float   t        = Mathf.Clamp(m_fTime * m_fSmashTimeScale, 0.0f, 1.0f);
                float   Angle    = Mathf.Lerp(0.0f, m_fSmashAngle, t);
                Vector3 ObjAngle = m_vObjInitRot;
                ObjAngle.x += Angle;
                m_BringObj.transform.eulerAngles = ObjAngle;
            }
        }
예제 #6
0
        /// <summary>
        /// 更新
        /// </summary>
        void Update()
        {
            m_fTime += Time.deltaTime;

            if (m_fTime >= m_fMoveTime)
            {
                Destroy(this);
            }

            m_Mover.LocalMove(m_Player.DashSpeed * Time.deltaTime);
        }
예제 #7
0
        /// <summary>
        /// 更新
        /// </summary>
        void Update()
        {
            //----- 回転
            m_fTime += Time.deltaTime;
            float   time  = m_fTime / m_fRotTime;                       // 割合計算(0.0 ~ 1.0
            Vector3 angle = transform.eulerAngles;

            // 角度の線形保管
            angle.y = Mathf.LerpAngle(m_fRotInit, m_fRotAim, time);
            transform.eulerAngles = angle;

            //----- 移動
            m_Mover.LocalMove(m_fRunSpeed * Time.deltaTime);
        }
예제 #8
0
        /// <summary>
        /// 更新
        /// </summary>
        void Update()
        {
            m_Mover.LocalMove(m_fSpeed * Time.deltaTime * 60.0f);
            Camera.main.transform.LookAt(m_BringObj.transform.position + m_vLookGap);

            m_fTimeFade += Time.deltaTime;
            if (!m_bFade &&
                m_fTimeFade >= m_fBeginFadeTime)
            {
                // フェード開始
                m_bFade = true;
                Camera.main.GetComponent <ShakeCamera> ().MoveGoal();
                GetComponent <Truck> ().GoalMove();
            }
        }
예제 #9
0
        /// <summary>
        /// 更新
        /// </summary>
        void Update()
        {
            // 例外処理
            if (!m_bTrig)
            {
                return;
            }

            //----- 回転
            m_fTime += Time.deltaTime;
            float   time  = m_fTime / m_fRotTime;
            Vector3 angle = transform.eulerAngles;

            angle.y = Mathf.LerpAngle(m_fRotInit, m_fRotAim, time);
            transform.eulerAngles = angle;

            // 移動
            m_Mover.LocalMove(m_fSpeed * Time.deltaTime);
        }
예제 #10
0
        /// <summary>
        /// 更新
        /// </summary>
        void Update()
        {
            m_fTime += Time.deltaTime;

            // 座標
            m_Mover.LocalMoveY(m_fMoveY / 2.5f + (Mathf.Cos(Mathf.PI * 2.0f / m_fCycleTime * m_fTime * 2.0f) * m_fMoveY));
            m_Mover.LocalMove(Mathf.Sin(Mathf.PI * 2.0f / m_fCycleTime * m_fTime) * m_fMoveZ);

            // 角度
            Vector3 vAngle = transform.eulerAngles;

            vAngle.x = m_fInitAngle + (Mathf.Sin(Mathf.PI * 2.0f / m_fCycleTime * m_fTime) * m_fRotateAngle);
            transform.eulerAngles = vAngle;

            if (m_fTime >= m_fCountMax)
            {
                this.enabled = false;
            }

            SEPlay();
        }
예제 #11
0
 /// <summary>
 /// 更新
 /// </summary>
 void Update()
 {
     // 移動
     m_Mover.LocalMove(m_Truck.Speed * Time.deltaTime);
 }