//------------------------------------------------------------------------------------------
 // 破裂エフェクトの生成
 //------------------------------------------------------------------------------------------
 private void GenerateBurstEffect()
 {
     EffectGenerator.BubbleBurstFX(
         new BubbleBurstFX.Param(Color.white, renderObject.transform.lossyScale),
         transform.position,
         null);
 }
Exemple #2
0
    protected void generateEffect(RegionEffect re)
    {
        EffectGenerator eg = Instantiate(re.eg, obj_effects.transform);

        eg.setRegion(this);
        //eg.init(this,_mapBoundsController.left,_mapBoundsController.right,_mapBoundsController.top,_mapBoundsController.bottom);
    }
        protected override IEnumerator Load()
        {
            var waitForCount = new WaitForCount();

            System.Action pre  = waitForCount.inc;
            System.Action done = waitForCount.dec;

            var rm = ResourceSystem.Instance;

            rm.Load <GameObject>("Title.Logo.prefab", pre, done, (res) => { this.logoPrefab = res; });
            rm.Load <GameObject>("Title.MenuCpu.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.MenuVs.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.MenuDemo.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.MenuOption.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.EffectGenerator.prefab", pre, done, (res) => { this.effectPrefab = res; });
            rm.Load <GameObject>("Cursor.CatPaw.prefab", pre, done, (res) => { this.cursorPrefab = res; });
            rm.Load <AudioClip>("BGM.001", pre, done);
            rm.Load <AudioClip>("SE.Select01", pre, done);
            TitleLogo.Load(pre, done);
            Menu.Load(pre, done);
            Paw.Load(pre, done);
            EffectGenerator.Load(pre, done);

            yield return(waitForCount);

            this.isLoaded = true;
            this.state.SetState(State.Setup);
        }
Exemple #4
0
 //------------------------------------------------------------------------------------------
 // 破裂エフェクトの生成
 //------------------------------------------------------------------------------------------
 private void GenerateBurstEffect()
 {
     EffectGenerator.BubbleBurstFX(
         new BubbleBurstFX.Param(GetComponent <SpriteRenderer>().color, transform.localScale),
         transform.localPosition,
         null);
 }
Exemple #5
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.transform.tag == "Player" && !burst)
     {
         SoundPlayer.Play(burstSE);
         Vector2 effectSize = Vector2.one * 1.5f;
         EffectGenerator.BubbleBurstFX(
             new BubbleBurstFX.Param(this.GetComponent <SpriteRenderer>().color, effectSize),
             transform.position,
             null);
         burst = true;
         GameObject.Find(Common.Camera.MAIN_CAMERA).GetComponent <CameraShake>().Shake(0.1f, 1.0f);
     }
     if (collision.transform.tag == "Bullet" && !burst)
     {
         SoundPlayer.Play(burstSE, 0.7f);
         Vector2 effectSize = Vector2.one * 3.5f;
         EffectGenerator.BubbleBurstFX(
             new BubbleBurstFX.Param(this.GetComponent <SpriteRenderer>().color, effectSize),
             transform.position,
             null);
         burst = true;
         GameObject.Find(Common.Camera.MAIN_CAMERA).GetComponent <CameraShake>().Shake(0.1f, 1.0f);
     }
 }
        //-------------------------------------------------------------------------
        // ステートマシン

        /// <summary>
        /// リソースからゲームオブジェクトを生成する
        /// </summary>
        private void OnSetupEnter()
        {
            // タイトルロゴ
            this.logo = Instantiate(this.logoPrefab).GetComponent <TitleLogo>();
            this.logo.SetParent(this.CacheTransform);
            this.logo.SetActive(false);

            // カーソル
            this.cursor = Instantiate(this.cursorPrefab).GetComponent <Paw>();
            this.cursor.SetParent(this.CacheTransform);
            this.cursor.SetActive(false);
            this.cursor.PadNo = 0;

            // メニュー
            this.menuPrefabs.ForEach((prefab) => {
                var menu = Instantiate(prefab).GetComponent <Menu>();
                menu.SetParent(this.CacheTransform);
                menu.SetActive(false);
                menu.SceneType = SceneSystem.SceneType.Title;
                this.menus.Add(menu);
            });

            // エフェクト
            this.effect = Instantiate(this.effectPrefab).GetComponent <EffectGenerator>();
            this.effect.SetParent(this.CacheTransform);

            // Introへ
            this.state.SetState(State.Intro);
        }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "CollectObject")
        {
            // リスポーン位置を設定
            Data.initialPlayerPos = collision.gameObject.transform.position;
        }

        if (collision.tag == Stage.GROUND || collision.tag == Bubble.GROUND || collision.tag == Common.Floor.NAME || collision.tag == "DamageTile")
        {
            isGround   = true;
            jumpCount  = 0;
            boostCount = 2;

            // 着地エフェクト(保留)
            if (!IsDead())
            {
                Vector2 effectSize = Vector2.one * 0.7f;
                EffectGenerator.BubbleBurstFX(
                    new BubbleBurstFX.Param(this.GetComponent <SpriteRenderer>().color, effectSize, 160, 4),
                    new Vector2(this.transform.position.x, this.transform.position.y - 1.0f),
                    null);
            }
        }

        // バブルキャノン(仮)
        if (collision.gameObject.tag == "BubbleCannon")
        {
            collision.gameObject.transform.parent.gameObject.GetComponent <BubbleCannon>().HitToPlayer();
            rig.velocity = rig.velocity * 0.0f;
            float sticV = Input.GetAxis(Player.VERTICAL);
            Mathf.Abs(sticV); // 入力の度合

            if (Input.GetAxis(Player.VERTICAL) <= 0.0f && sticV >= 0.1f)
            {
                rig.AddForce(new Vector2(boostForce.x * 1.3f * Input.GetAxis(Player.HORIZONTAL), boostForce.y * 1.3f * Input.GetAxis(Player.VERTICAL)), ForceMode2D.Impulse);
            }
            else
            {
                rig.AddForce(new Vector2(boostForce.x * 1.3f * Input.GetAxis(Player.HORIZONTAL), (boostForce.y * 1.3f * Input.GetAxis(Player.VERTICAL)) + 10.0f), ForceMode2D.Impulse);
            }
            // ブースト回数の回復
            boostCount = 2;
        }

        // バブルチャージ
        if (collision.gameObject.tag == "BubbleCharge")
        {
            Boost(Vector3.zero);
        }

        // 汚れ
        if (collision.gameObject.tag == "Dirt")
        {
            dirtManager.EnterDirt(collision.gameObject);
        }
    }
Exemple #8
0
 public override void HittingObject(Collider collision, bool k)
 {
     if (c < 0.05f)
     {
         return;
     }
     EffectGenerator.CreateEffect(EffectType.Explosion_3x3, transform.position);
     Destroy(gameObject);
 }
Exemple #9
0
    public void HitToPlayer()
    {
        currentStatus = Status.Dead;
        deadCount     = restorationCount;
        Vector2 effectSize = Vector2.one * 1.5f;

        EffectGenerator.BubbleBurstFX(
            new BubbleBurstFX.Param(Color.white, effectSize),
            transform.position,
            null);
        transform.GetChild(0).gameObject.SetActive(false);
    }
Exemple #10
0
    //------------------------------------------------------------------------------------------
    // Update
    //------------------------------------------------------------------------------------------
    private void Update()
    {
        var rate = dirt.CleaningRate();

        ChangeAlpha(1.0f - 1.0f * rate);
        if (rate >= 1 && !cleaned)
        {
            Data.initialPlayerPos = this.transform.position;
            EffectGenerator.CleanFX(new CleanFX.Param(new Vector2(1, 4)), transform.position);
            cleaned = true;
        }
    }
Exemple #11
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == Player.NAME && !atOnce)
     {
         atOnce = true;
         // バブルを生成(複数個)
         bubbleG.BubbleCreate(this.transform.position, num_bubble, false);
         Destroy(this.gameObject);
         Vector2 effectSize = Vector2.one * 1.5f;
         EffectGenerator.BubbleBurstFX(new BubbleBurstFX.Param(Color.white, effectSize), transform.position, null);
     }
 }
    public void Jump(bool superJump)
    {
        if (this.m_NoJump)
        {
            return;
        }
        bool flag = false;

        if (this.m_NavMeshAgent != null)
        {
            this.m_NavMeshAgent.enabled   = false;
            this.m_PlayerMotor.enabled    = true;
            this.m_PlayerMotor.m_NavAgent = false;
        }
        if (superJump)
        {
            this.m_PlayerMotor.jumpHeight = 5f;
            this.m_PlayerMotor.gravity    = 15f;
            GameObject gameObject = EffectGenerator.CreateEffectGameObject("ep02_jump_01");
            if (gameObject != null)
            {
                Transform transform = TransformTool.SearchHierarchyForBone(base.transform, "Bip001 Footsteps");
                if (transform != null)
                {
                    gameObject.transform.position = transform.position;
                    gameObject.transform.parent   = transform;
                }
                UnityEngine.Object.DestroyObject(gameObject, 3f);
            }
            this.m_JumpMotor.IsSuperJump = true;
            this.m_PlayerMotor.Jump();
            return;
        }
        bool flag2 = false;

        if (!this.m_LockControl && !this.m_EnterTalk && !flag)
        {
            flag2 = true;
        }
        if (GameInput.GetJoyKeyDown(JOYSTICK_KEY.Y))
        {
            flag2 = true;
        }
        if (flag2)
        {
            this.m_PlayerMotor.jumpHeight = this.m_JumpHeight;
            this.m_PlayerMotor.gravity    = this.m_JumpGravity;
            this.m_JumpMotor.IsSuperJump  = false;
            this.m_PlayerMotor.Jump();
        }
    }
    //------------------------------------------------------------------------------------------
    // ブースト移動
    //------------------------------------------------------------------------------------------
    public bool UseBoost(float useSize, float effectSize)
    {
        if (!UseBalloon(useSize))
        {
            return(false);
        }

        EffectGenerator.BubbleBurstFX(
            new BubbleBurstFX.Param(Color.white, Vector2.one * effectSize),
            transform.position,
            null);

        return(true);
    }
Exemple #14
0
    public override void HittingObject(Collider collision, bool k)
    {
        Debug.Log("call override hit methods!!");
        Vector3 ww = point;

        if (k)
        {
            Debug.Log("create blood splash");
            EffectGenerator.CreateEffect(EffectType.GunDamageBlood, collision.ClosestPoint(transform.position)).transform.LookAt(ww);
        }
        else
        {
            Debug.Log("create holes");
            var r = (Instantiate(Resources.Load("GUN/holes"), collision.ClosestPoint(transform.position), Quaternion.identity) as GameObject);
            r.transform.LookAt(ww);
            r.GetComponent <EffectLimitter>().SetLifeTime(5);
        }
        Destroy(gameObject);
    }
Exemple #15
0
        protected override void OnMyDestory()
        {
            SoundSystem.Instance.StopBGM();
            var rm = ResourceSystem.Instance;

            rm.Unload("Title.Logo.prefab");
            rm.Unload("Title.MenuCpu.prefab");
            rm.Unload("Title.MenuVs.prefab");
            rm.Unload("Title.MenuDemo.prefab");
            rm.Unload("Title.MenuOption.prefab");
            rm.Unload("Title.EffectGenerator.prefab");
            rm.Unload("Cursor.CatPaw.prefab");
            rm.Unload("BGM.001");
            rm.Unload("SE.Select01");

            TitleLogo.Unload();
            Menu.Unload();
            Paw.Unload();
            EffectGenerator.Unload();
        }
Exemple #16
0
    //------------------------------------------------------------------------------------------
    // Update
    //------------------------------------------------------------------------------------------
    private void Update()
    {
        if (beingSwept && !wasCleaned)
        {
            sweepCount++;

            float a = Mathf.Max(1 - (sweepCount * 1.0f / sweepLevel), 0.0f);
            a           = a * alphaRate + (1 - alphaRate);
            targetAlpha = defaultAlpha * a;

            if (sweepCount >= sweepLevel)
            {
                targetAlpha = 0;
                dirtManager.DirtCleaned(amount);
                wasCleaned = true;

                var collider = GetComponent <BoxCollider2D>();
                var size     = collider.size * transform.lossyScale;
                var offset   = collider.offset * transform.lossyScale;
                EffectGenerator.CleanFX(new CleanFX.Param(size), transform.position + (Vector3)offset);

                SoundPlayer.Play(audios[(int)AudioType.End]);
            }

            SoundPlayer.Play(audios[(int)AudioType.Cleaning]);
            beingSwept = false;
        }
        currentAlpha = Mathf.Lerp(currentAlpha, targetAlpha, 0.2f);
        var color = spriteRenderer.color;

        color.a = currentAlpha;
        spriteRenderer.color = color;


        timer += Time.deltaTime;
        hsvController.brightnessMultiply = Mathf.Lerp(brightnessMin, brightnessMax, Mathf.Sin(timer * Mathf.PI * 2 * blinkSpeed) * 0.5f + 0.5f);
    }
Exemple #17
0
    //------------------------------------------------------------------------------------------
    // 死亡時処理
    //------------------------------------------------------------------------------------------
    private void DeathUpdate()
    {
        if (!playerIsDead)
        {
            if (Data.time <= 0)
            {
                return;
            }

            deathAnimationState = DeathAnimationInfo.DeathAnimatonState.Death;
            playerIsDead        = true;
            deathAnimationTimer = 0;
            deathAnimationInfo.bubble.SetActive(false);
            animator.SetInteger("DeathState", 1);
        }

        deathAnimationTimer += Time.deltaTime;
        switch (deathAnimationState)
        {
        case DeathAnimationInfo.DeathAnimatonState.Death:
            if (deathAnimationTimer >= deathAnimationInfo.deathAnimationTime)
            {
                deathAnimationState = DeathAnimationInfo.DeathAnimatonState.Appear;
                deathAnimationTimer = 0;
                deathAnimationInfo.bubble.SetActive(true);
                deathAnimationInfo.bubble.transform.localScale = new Vector3(0, 0, 1);
            }
            break;

        case DeathAnimationInfo.DeathAnimatonState.Appear:
            float t2 = Mathf.Min(deathAnimationTimer / deathAnimationInfo.bubbleAppearTime, 1);
            t2 *= 2;
            deathAnimationInfo.bubble.transform.localScale = new Vector3(3 * t2, 3 * t2, 1);
            if (deathAnimationTimer >= deathAnimationInfo.bubbleAppearTime)
            {
                deathAnimationState = DeathAnimationInfo.DeathAnimatonState.Move;
                deathAnimationTimer = 0;
                deathPos            = player.transform.position;
            }
            break;

        case DeathAnimationInfo.DeathAnimatonState.Move:
            float t3 = Mathf.Min(deathAnimationTimer / deathAnimationInfo.bubbleMoveTime, 1);
            t3 = t3 * (2 - t3);
            player.transform.position = Vector3.Lerp(deathPos, Data.initialPlayerPos + Vector3.up * 0.1f, t3);
            if (deathAnimationTimer >= deathAnimationInfo.bubbleMoveTime)
            {
                deathAnimationState = DeathAnimationInfo.DeathAnimatonState.Burst;
                deathAnimationTimer = 0;
                deathAnimationInfo.bubble.SetActive(false);
                player.GetComponent <Rigidbody2D>().velocity *= 0.0f;
                EffectGenerator.BubbleBurstFX(new BubbleBurstFX.Param(Color.white, Vector2.one * 3), Data.initialPlayerPos + Vector3.up * 0.1f);
            }
            break;

        case DeathAnimationInfo.DeathAnimatonState.Burst:
            if (deathAnimationTimer >= deathAnimationInfo.bubbleBurstTime)
            {
                deathAnimationState = DeathAnimationInfo.DeathAnimatonState.Repair;
                animator.SetInteger("DeathState", 2);
                deathAnimationTimer = 0;
            }
            break;

        case DeathAnimationInfo.DeathAnimatonState.Repair:
            if (deathAnimationTimer >= deathAnimationInfo.repairAnimationTime)
            {
                playerIsDead = false;
                if (Data.time > 0)
                {
                    player.Repair();
                }
                animator.SetInteger("DeathState", 0);
            }
            break;

        default:
            break;
        }
    }
Exemple #18
0
 public void init(EffectGenerator eg)
 {
     generator = eg;
 }
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Npc")
     {
         this.m_EnterTalk = true;
     }
     if (other.tag == "MusicEvent")
     {
         other.gameObject.SendMessage("OnTalk", SendMessageOptions.DontRequireReceiver);
         if (Swd6Application.instance.m_ResourceType == ENUM_ResourceType.Develop)
         {
             Debug.Log("執行切換音樂事件_" + other.name);
         }
     }
     if (other.tag == "Event")
     {
         this.m_EnterTalkEvent = true;
         if (Swd6Application.instance.gameStateService.getCurrentState().name == "GameMenuState")
         {
             Swd6Application.instance.PopState();
         }
         if (base.MoveRole)
         {
             return;
         }
         other.gameObject.SendMessage("OnTalk", SendMessageOptions.DontRequireReceiver);
         if (Swd6Application.instance.m_ResourceType == ENUM_ResourceType.Develop)
         {
             Debug.Log("執行事件_" + other.name);
         }
     }
     if (other.tag == "BattleEvent")
     {
         Swd6Application.instance.m_ExploreSystem.SetBattleAreaState(other.name);
     }
     if (other.tag == "WaterEvent" || other.tag == "WaterEvent2")
     {
         if (!this.m_WalkInWater)
         {
             string name;
             if (other.tag == "WaterEvent")
             {
                 name = "footstep_Water1";
                 this.m_FootStepWaterName = "footstep_Water2";
             }
             else
             {
                 name = "footstep_Blood1";
                 this.m_FootStepWaterName = "footstep_Blood2";
             }
             if (this.IsJumpOver())
             {
                 int num = 256;
                 num = ~num;
                 RaycastHit raycastHit = default(RaycastHit);
                 if (Physics.Raycast(new Ray
                 {
                     origin = base.gameObject.transform.position + new Vector3(0f, 1f, 0f),
                     direction = new Vector3(0f, -1f, 0f)
                 }, out raycastHit, 1000f, num))
                 {
                     GameObject gameObject = EffectGenerator.CreateEffectGameObject(name);
                     if (gameObject != null)
                     {
                         gameObject.transform.position = raycastHit.point;
                     }
                     gameObject = EffectGenerator.CreateEffectGameObject(this.m_FootStepWaterName);
                     if (gameObject != null)
                     {
                         gameObject.transform.position = raycastHit.point;
                     }
                 }
                 MusicControlSystem.PlaySound(3662, 1);
             }
         }
         this.m_WalkInWater = true;
     }
 }
Exemple #20
0
    protected override IEnumerator BehaviourCoroutine()
    {
        unitInfo.ChangeState(UnitInfo.UnitState.action);
        animator.CrossFade(GetActionName(), 0);
        unitInfo.GetMovement().Stop();
        unitInfo.GetMovement().StopRotating();
        float     deltaZ        = 0;
        float     deltaY        = 0;
        Transform unitTransform = unitInfo.transform;
        Vector3   startPosition = unitTransform.position;
        Vector3   newPosition   = unitTransform.position;
        Rigidbody rigid         = unitInfo.GetMovement().GetRigidBody();
        GenericIK ik            = unitTransform.GetComponent <GenericIK>();

        ik.ToggleIK(false);
        Vector3 forward  = unitTransform.forward;
        float   distance = dashDistance - offsetZ;

        if (targetObject != null)
        {
            forward  = (targetObject.position - unitTransform.position).normalized;
            distance = Vector3.Distance(targetObject.position, unitTransform.position) - offsetZ;
        }
        bool rotated = false;

        while (behaviourState < 2)
        {
            deltaZ = animator.GetFloat("posZ");
            deltaY = animator.GetFloat("posY");
            if (deltaY >= 0.9f)
            {
                rotated = false;
            }
            if (deltaZ > 0.1f && !rotated)
            {
                rotated   = true;
                forward.y = 0;
                unitInfo.GetMovement().RotateTo(forward, 5);
                unitInfo.GetMovement().GetRigidBody().useGravity = false;
                //unitInfo.GetMovement().enabled = false;
            }
            newPosition    = startPosition + forward * deltaZ * distance + unitTransform.up * deltaY * dashHeight;
            rigid.position = (newPosition);

            yield return(null);
        }
        GameObject cameraObject = ControlManager.Instance.mainCameraObject;

        if (Vector3.Distance(cameraObject.transform.position, unitTransform.position) <= impactRadius * 2)
        {
            cameraObject.GetComponent <CameraShaker>().ShakeCamera(1, 0.3f);
        }
        DamageInfo[] dInfos = DamageGenerator.ApplyRadialDamage(unitInfo, unitTransform.position, impactRadius, 1, false, LayerMask.GetMask("Unit"));
        foreach (DamageInfo dinfo in dInfos)
        {
            Vector3 f     = unitInfo.transform.position - dinfo.hitPoint;
            Vector3 euler = Quaternion.LookRotation(f).eulerAngles;
            euler.x = 0;
            euler.z = 0;
            dinfo.hitUnit.transform.eulerAngles = euler;
            dinfo.hitUnit.GetComponent <Rigidbody>().velocity = Vector3.up * 1 + (dinfo.hitUnit.transform.position - unitTransform.position).normalized * knockBackDistance;
            dinfo.hitUnit.GetAction().StopAction();
            dinfo.hitUnit.AddCrowdControl(ConditionData.UnitCondition.knockBack, 1,
                                          delegate() { dinfo.hitUnit.GetComponent <ActionComponent>().UseSkill("WakeUp", true); });
        }
        EffectGenerator effect = unitInfo.GetComponent <EffectGenerator>();

        effect.GenerateEffect("DashDust");
        yield return(new WaitForStateChange(this, 3));

        Reset();
        StopAction();
    }
    //------------------------------------------------------------------------------------------
    // Update
    //------------------------------------------------------------------------------------------
    void Update()
    {
        jumpTiming = false;

        // 故障中の処理
        if (deathFlag)
        {
            DeathUpdate();
        }

        // 敵接触カウント
        if (hitCount > 0)
        {
            hitCount--;
        }

        if (autoControl)
        {
            bulletGenerator.DisableGuideLines();
            if (transform.position.x < targetPos.x - 0.1f)
            {
                Data.playerDir   = lastDir = dir = 1;
                stickSence       = 0.1f;
                autoMoveFinished = false;
            }
            else if (transform.position.x > targetPos.x + 0.1f)
            {
                Data.playerDir   = lastDir = dir = -1;
                stickSence       = 0.1f;
                autoMoveFinished = false;
            }
            else
            {
                dir              = 0;
                stickSence       = 0;
                autoMoveFinished = true;
            }

            return;
        }

        if (!canControl)
        {
            dir = Integer.ZERO;
            bulletGenerator.DisableGuideLines();
            return;
        }

        // プレイヤー操作系統 (入力が必要なもの)--------------------------------------------------
        // コントローラの接続チェック
        checkController = gamaepadManager.GetCheckGamepad();

        // 左右移動
        if (Input.GetAxis(Player.HORIZONTAL) < Integer.ZERO)
        {
            dir        = -1;
            dirCount   = turnCount;
            stickSence = Input.GetAxis(Player.HORIZONTAL);
        }
        else if (Input.GetAxis(Player.HORIZONTAL) > Integer.ZERO)
        {
            dir        = 1;
            dirCount   = turnCount;
            stickSence = Input.GetAxis(Player.HORIZONTAL);
        }
        else
        {
            dir = 0;
        }

        // バレットの発射
        bool releaseAttack = Input.GetButtonUp(Player.ATTACK);
        var  balloonFloor  = Input.GetAxis(GamePad.BUTTON_B);

        if (releaseAttack && Data.balloonSize >= bulletCost)
        {
            float angle = 0.0f;
            float v     = Input.GetAxis(Player.VERTICAL);
            float h     = Input.GetAxis(Player.HORIZONTAL);
            if (Mathf.Abs(h) > 0.1f || Mathf.Abs(v) > 0.1f)
            {
                angle = Mathf.Atan2(v, h);
            }
            else if (Data.playerDir < 0)
            {
                angle = Mathf.PI;
            }
            if (bulletGenerator.BulletCreate(transform.position, angle))
            {
                balloonController.UseBalloon(bulletCost);
            }
        }

        // バレットの発射ボタンを押している間、ガイドラインを表示する
        if (Input.GetButton(Player.ATTACK))
        {
            stickSence = 0.0f;
            dir        = 0;
            var inputDir = new Vector2(Input.GetAxis(Player.HORIZONTAL), Input.GetAxis(Player.VERTICAL));
            if (inputDir.magnitude > 0)
            {
                bulletGenerator.EnableGuideLines(transform.position, Mathf.Atan2(inputDir.y, inputDir.x));
            }
            else
            {
                bulletGenerator.EnableGuideLines(transform.position, (Data.playerDir >= 0 ? 0 : Mathf.PI));
            }
        }
        else
        {
            bulletGenerator.DisableGuideLines();
        }

        // 空中ブースト
        jumpButton  = Input.GetAxis(Player.JUMP);
        boostButton = Input.GetAxis(Player.BOOST);
        float sticV = Mathf.Abs(Input.GetAxis(Player.VERTICAL));

        if ((jumpButton > 0 && jumpButtonTrigger == 0.0f && boostCost <= Data.balloonSize && jumpCount > 0) || (boostButton > 0 && boostButtonTrigger == 0.0f && boostCost <= Data.balloonSize))
        {
            Vector2 direction = new Vector2(Input.GetAxis(Player.HORIZONTAL), Input.GetAxis(Player.VERTICAL));
            if (sticV <= 0.1f)
            {
                direction.y = 0;
            }
            direction.Normalize();

            Boost(direction);

            // エフェクトを生成する
            EffectGenerator.BoostTrailFX(new BoostTrailFX.Param(Color.white, 0.5f, rig), transform.position);
            balloonController.UseBoost(boostCost, 1.3f);

            SoundPlayer.Play(audios[(int)AudioType.Acceleration]);

            boostCount--;
        }

        // エネミーを利用したブースト(仮)
        if (isEnemyBoost)
        {
            Boost(Vector3.zero);
        }


        // ジャンプ
        if (hitCount == 0)
        {
            if (canJump && jumpButton > 0 && jumpButtonTrigger == 0.0f && isGround)
            {
                if (this.rig.velocity.y <= 0)
                {
                    jumpCount = 1;
                    rig.AddForce(new Vector2(0, jumpForce));
                    isGround     = false;
                    jumpStopFlag = false;
                    jumpTiming   = true;

                    SoundPlayer.Play(audios[(int)AudioType.Jump]);
                }
            }
        }

        // 前フレームのキー入力の情報保持
        // Jump
        jumpButtonTrigger = jumpButton;
        // Boost
        boostButtonTrigger = boostButton;
        // ------------------------------------------------------------------------------


        // 切り替えし(地上にいるときのみ)
        if (isGround)
        {
            if (lastDir > 0.0f && dir == -1)
            {
                bubbleGenerator.BubbleCreate(transform.position, 1, true);
                dirtManager.SweepDirt();
            }
            if (lastDir < 0.0f && dir == 1)
            {
                bubbleGenerator.BubbleCreate(transform.position, 1, true);
                dirtManager.SweepDirt();
            }
        }

        // 最終入力方向
        dirCount--;
        if (dirCount <= 0 || dir != 0)
        {
            lastDir = dir;
        }

        // プレイヤーの向き保持
        if (dir != 0)
        {
            Data.playerDir = dir;
        }

        // プレイヤーの速度取得
        Data.prePlayerVel     = Data.currentPlayerVel;
        Data.currentPlayerVel = this.rig.velocity;

        // 重力の変更(バブルの個数に応じて)
        float buoyancy = Mathf.Min(maxPowerBalloonSize, Data.balloonSize) / maxPowerBalloonSize;
        float t        = buoyancy * buoyancy;

        rig.gravityScale = Mathf.Lerp(5.0f, 1.5f, t);
        jumpForce        = defaultJumpForce * Mathf.Lerp(1.0f, 0.9f, t);
        playerSpeed      = accelForce * Mathf.Lerp(1.0f, 0.85f, t);

        // エネミーブーストのリセット
        isEnemyBoost = false;
    }