private void OnCollisionEnter(Collision collision) //碰撞 { if ((GameData.PlayerInput.State.ToString() == "JumpState" || GameData.PlayerInput.State.ToString() == "InitState") && GameData.PlayerInput.State.ToString() != "GameOver_") { JumpState.SetIdleState(collision.gameObject); } if (collision.gameObject.name == "Floor" && GoMgr.CurrentBox.name != "Floor") { StartCoroutine("PlayDieMusic"); return; } if (DieTest(GoMgr.CurrentBox, collision)) { return; } if (GoMgr.CurrentBox == collision.gameObject) { return; } GoMgr.CurrentBox = collision.gameObject; if (GoMgr.CurrentBox != GoMgr.TargetBox && GoMgr.Player.transform.position.y < 0.6f) { return; } BoxData.InsBox(); CameraMove.isCamMove = true; GoMgr.CurrentBox.GetComponent <BoxData>().CorePoint(GoMgr.CurrentBox); BoxData.BoxDelete(); GameObject.FindGameObjectWithTag("Floor").GetComponent <FloorFolllow>().FloorFollowFun(); }
void Start() { BoxData.InsBox(); CameraMove.isCamMove = true; }