예제 #1
0
    private void StartCounting()
    {
        //******************** サウンド処理(担当:野村) ********************
        SoundSpeaker SoundDevice = GetComponent <SoundSpeaker>();

        startCount--;
        try {
            countDownTextureScroll.GetComponent <TextureScroll>().StopHorizontalExecutionFlag(startCount - 1, true);
        } catch {
            print("game manager count down scroll error");
        }

        //カウントダウンを終了して走り始める場合
        if (startCount <= 0)
        {
            //tm.text = "Go !!";
            countDownTextureScroll.renderer.material    = goMaterial;
            countDownTextureScroll.transform.localScale = new Vector3(4, 2.5f, 1);
            Destroy(countDownTextureScroll.GetComponent <TextureScroll>());
            CancelInvoke("StartCounting");
            Invoke("StartStringHide", 2);
            gameState = GameState.Play;

            SoundDevice.PlaySE((int)(CommonSound.SE_NAME.SE_COUNTDOWN_BACK), false);                                    //カウントダウン後半用SEを再生する
        }
        //カウントダウンの値が0以外=スタートではない場合
        else
        {
            SoundDevice.PlaySE((int)(CommonSound.SE_NAME.SE_COUNTDOWN_FRONT), false);                                   //カウントダウン前半用SEを再生する
        }
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     ss = GetComponent <SoundSpeaker>();
     try {
         ss.PlaySE((int)CommonSound.SE_NAME.SE_CHEER2, false);
     } catch {
         print("fever good cheer error");
     }
 }
예제 #3
0
    private TextureScroll ScrollDevice;                 //自身が持つスクロールデバイス

    //++++++++++ プロテクト ++++++++++

    //++++++++++ パブリック ++++++++++

    //====================================================================================================
    //メソッド名	:Awake
    //役割			:コンストラクタ的な
    //引数			:void
    //戻り値		:void
    //作成者		:Nomura Syouhei
    //====================================================================================================
    void Awake()
    {
        //******************** 初期化処理 ********************
        //コンポーネント取得(デバイス生成)
        SoundSpeaker = this.GetComponent <SoundSpeaker>();              //サウンドスピーカー
        ScrollDevice = this.GetComponent <TextureScroll>();             //テスクチャスクロールデバイス

        //生成したこのMOBを、MOBManagerに格納する
        GameObject.Find("MOBManager").GetComponent <MOBManager>().SetMobAddress(this.name, -1);
    }
예제 #4
0
    public override void Execute(Player player)
    {
        //******************** サウンド処理(担当:野村) ********************
        SoundSpeaker SoundDevice = GetComponent <SoundSpeaker>();                               //リングオブジェクトに内包されているSoundSpeakerスクリプトを取得する

        SoundDevice.PlaySE((int)(CommonSound.SE_NAME.SE_RING), false);                          //リング用SEを再生する

        FindObjectOfType <ScoreManager>().PlusNowScore(500);
        this.renderer.enabled = false;

        if (particleAddScore)
        {
            Instantiate(particleAddScore);                              // エフェクト(particleAddScore)を呼び出す
        }
    }
예제 #5
0
    public override void Execute(Player player)
    {
        try {
            player.speed = player.speedDefault * 0.3f;
            player.Invoke("UndoSpeed", 1.35f);
            player.StartStumble();
            player.Invoke("EndStumble", 1.35f);
            //******************** サウンド処理(担当:野村) ********************
            SoundSpeaker SoundDevice = GetComponent <SoundSpeaker>();                                   //ダッシュ床オブジェクトに内包されているSoundSpeakerスクリプトを取得する
            SoundDevice.PlaySE((int)(CommonSound.SE_NAME.SE_FALL), false);                              //ダッシュ床用SEを再生する

            //		FindObjectOfType<ScoreManager>().AddScore(100);
        } catch {
            print("stumble error");
        }
    }
예제 #6
0
    public override void Execute(Player player)
    {
        try {
            player.speed = player.speed * MULTIPLY_SPEED;
            player.speed = player.speed + ADD_SPEED;

            player.CancelInvoke("UndoSpeed");
            player.Invoke("UndoSpeed", 3);
            if (player.speed > MAX_SPEED)
            {
                player.speed = MAX_SPEED;
            }
            FindObjectOfType <ScoreManager>().PlusNowScore(100);
            //******************** サウンド処理(担当:野村) ********************
            SoundSpeaker SoundDevice = GetComponent <SoundSpeaker>();                                   //ダッシュ床オブジェクトに内包されているSoundSpeakerスクリプトを取得する
            SoundDevice.PlaySE((int)(CommonSound.SE_NAME.SE_DASH), false);                              //ダッシュ床用SEを再生する
        } catch {
            print("dash error");
        }
    }
예제 #7
0
 void Start()
 {
     m_speaker = GetComponent <SoundSpeaker>();
 }
예제 #8
0
    void Update()
    {
        if (!roadJoint)
        {
            anm.SetFloat(anmSpeedHash, 0);
            return;
        }

        UpdateRoadJointIs();

        float vertical   = speed * Time.deltaTime;
        float horizontal = (roadJointIs["Jump"] || roadJointIs["Parabola"] || Pause.paused) ? 0 : Input.GetAxis("Horizontal");

        if ((gm != null && gm.gameState != GameManager.GameState.Play) || anm.GetBool(anmLandingHash))
        {
            vertical *= 0;
        }

        if ((gm != null && gm.gameState != GameManager.GameState.Play))
        {
            return;
        }

        if (roadJointIs["Parabola"])
        {
            Vector3 vec = myBezier.GetPointAtTime(t);
            transform.position = vec;
            t += 0.005f * (speed / speedDefault);
            if (t > 1f)
            {
                t = 1f;
            }
        }
        else
        {
            transform.Translate(0, 0, vertical);
        }

        if (anm.GetBool(anmStumbleHash) == false)
        {
            anm.SetFloat(anmSpeedHash, vertical);
        }

        //キーが押されたら通常ジャンプ
        if (Input.GetButtonDown("Jump") && generateCircle == null && !Pause.paused)
        {
            if (anm.GetBool(anmRotHash) == false && anm.GetBool(anmJumpHash) == false && isFly == false && roadJoint.name.Contains("Road") && anm.GetBool(anmStumbleHash) == false && anm.GetBool(anmLandingHash) == false)
            {
                anm.SetBool(anmRotHash, true);
                anm.Play("Rotate");
                rigidbody.AddForce(Vector3.up * jumpPower, ForceMode.Impulse);
                isFly = true;

                //******************** サウンド処理(担当:野村) ********************
                SoundSpeaker SoundDevice = GetComponent <SoundSpeaker>();                                       //プレイヤーオブジェクトに内包されているSoundSpeakerスクリプトを取得する
                SoundDevice.PlaySE((int)(CommonSound.SE_NAME.SE_JUMP), false);                                  //ジャンプ用SEを再生する
            }
        }

        speed -= (speed - speedDefault) * 0.005f;

        line.SetPosition(0, new Vector3(0, -4, 2));
        line.SetPosition(1, new Vector3(0, -4, 2) + new Vector3(5, 0, -1).normalized *(speed / speedDefault) * 5);

        if (roadJoint.prevJoint && anm.GetBool(anmStumbleHash) == false && anm.GetBool(anmLandingHash) == false)
        {
            if (horizontal < 0)
            {
                float movingSpeed = -0.25f;
                offsetSide += movingSpeed;
                if (offsetSide < -4.5f)
                {
                    offsetSide = -4.5f;
                }
                else
                {
                    transform.position += roadJoint.transform.right * movingSpeed;
                }
                isChangeRoadNumber = true;
            }
            else if (horizontal > 0)
            {
                float movingSpeed = 0.25f;
                offsetSide += movingSpeed;
                if (offsetSide > 4.5f)
                {
                    offsetSide = 4.5f;
                }
                else
                {
                    transform.position += roadJoint.transform.right * movingSpeed;
                }
                isChangeRoadNumber = true;
            }
            else if (horizontal == 0)
            {
                isChangeRoadNumber = false;
            }
        }

        if (roadJointIs["Jump"] || roadJointIs["Parabola"])
        {
            rigidbody.useGravity = false;
            anm.SetBool(anmJumpHash, true);
        }
        else
        {
            rigidbody.useGravity = true;
        }

        TargetLock();

        if (generateCircle)
        {
            if (generateCircle.IfProcess(this))
            {
            }
        }

        if (roadJointIs["Wall"])
        {
            Vector3 v = rigidbody.velocity;
            v.x = v.z = 0;
            rigidbody.velocity = v;
        }
    }
예제 #9
0
    private void OnTriggerEnter(Collider collider)
    {
        try {
            SpecialFloor sf = collider.gameObject.GetComponent <SpecialFloor>();
            sf.Execute(this);
            return;
        } catch {
            //print("not special floor");
        }
        try {
            RoadJoint rj = collider.gameObject.GetComponent <RoadJoint>();
            if (rj.landing)
            {
                StartLandingAnimation(rj);
            }
            roadJoint = rj.nextJoint.GetComponent <RoadJoint>();
            UpdateRoadJointIs();
            if (generateJumpEffect)
            {
                Destroy(generateJumpEffect.gameObject);
                generateJumpEffect = null;
            }
            if (generateCircle)
            {
                // ステータスが良ければエフェクト生成
                if (generateCircle.state > 0)
                {
                }
                Destroy(generateCircle.gameObject);
                generateCircle = null;
            }
            if (roadJoint.nextJoint)
            {
                if (roadJoint.nextJoint.name.Contains("Parabola") || roadJoint.nextJoint.name.Contains("Jump"))
                {
                    if (roadJoint.nextJoint.GetComponent <RoadJoint>().NotCircle == false)
                    {
                        generateCircle                = (Instantiate(circle) as GameObject).GetComponent <Circle>();
                        generateCircle.player         = gameObject;
                        generateCircle.targetPosition = roadJoint.transform.position.Clone();
                    }
                }
            }

            Physics.gravity = Vector3.down * 39.2f;
            if (roadJointIs["Wall"])
            {
                Physics.gravity = (Vector3.up * 1.5f + roadJoint.transform.up) / 2 * -39.2f;
                transform.LookAt(roadJoint.transform);
            }
            else if (roadJointIs["Parabola"])
            {
                //演出Jump
                Vector3 p  = new Vector3(0.0f, 0.0f, 0.0f);
                Vector3 p0 = new  Vector3(0.0f, 0.0f, 0.0f);
                Vector3 p1 = new  Vector3(0.0f, 0.0f, 0.0f);
                Vector3 p2 = new  Vector3(0.0f, 0.0f, 0.0f);
                Vector3 p3 = new  Vector3(0.0f, 0.0f, 0.0f);
                t = 0;
                rigidbody.velocity = new Vector3(0, 0, 0);
                //	p0 = roadJoint.prevJoint.transform.position;
                p0 = roadJoint.prevJoint.transform.position.Clone();
                p3 = roadJoint.transform.position.Clone();
                Vector3 dir = p3 - p0;
                p1       = p0 + dir * 0.2f;
                p2       = p0 + dir * 0.8f;
                p1.y     = p2.y = (p0.y > p3.y) ? p0.y + 30 : p3.y + 30;
                myBezier = new Bezier(p0, p1, p2, p3);

                //******************** サウンド処理(担当:野村) ********************
                SoundSpeaker SoundDevice = GetComponent <SoundSpeaker>();                                       //ダッシュ床オブジェクトに内包されているSoundSpeakerスクリプトを取得する
                SoundDevice.PlaySE((int)(CommonSound.SE_NAME.SE_JUMP), false);                                  //ダッシュ床用SEを再生する
            }
            if (roadJointIs["Wall"] || roadJointIs["Jump"] || roadJointIs["Parabola"])
            {
                rigidbody.velocity = Vector3.zero;
            }
            return;
        } catch {
            roadJoint = null;
            //print("not road joint");
        }
    }