// Update is called once per frame void Update() { if (finisher.Finish() == true) { doNotDisturb = true; } if (doNotDisturb == false) { particle.GoParticle(); //移動 if (Input.GetKey(KeyCode.RightArrow)) { myTrans.Translate(speed, 0.0f, 0.0f, Space.Self); myTrans.localScale = new Vector3(-0.3f, 0.3f, 1); } else if (Input.GetKey(KeyCode.LeftArrow)) { myTrans.Translate(speed * -1, 0.0f, 0.0f, Space.Self); myTrans.localScale = new Vector3(0.3f, 0.3f, 1); } //ジャンプ if (Input.GetKeyDown(KeyCode.UpArrow) && OnGround == true) { this.gameObject.GetComponent <Rigidbody>().AddForce(transform.up * jump_power); OnGround = false; } if (Input.GetKey(KeyCode.Space)) { ChangeSprite(player_vacume); } else { ChangeSprite(player_default); } speed = (OnGround == false)? 0.05f : 0.1f; } //惑星の切り替え if (player_state == 0) { Planet1.layer = LayerMask.NameToLayer("Default"); Planet2.layer = LayerMask.NameToLayer("PlanetSurface"); } else { Planet1.layer = LayerMask.NameToLayer("PlanetSurface"); Planet2.layer = LayerMask.NameToLayer("Default"); } }