/// <summary> /// 指定した方向を向く /// </summary> private void LookAtDesignationAngle(PlayerAngle playerAngle) { Vector3 angle = transform.eulerAngles; playerAngleState = playerAngle; angle.y = (float)playerAngle; transform.eulerAngles = angle; }
/// <summary> /// 壁に張り付いている時のジャンプ /// </summary> private bool WallJump() { // 壁に触れてる true // 地面に触れてる false if (!playerComponent.wallTouchComponent.isTouch) { return(false); } if (isGroundTouch) { return(false); } Debug.Log("壁ジャンプ開始"); // 移動量代入 //jumpWallXPower = transform.eulerAngles.y == 0.0f ? -jumpWallPower.x : jumpWallPower.x; // 右を向いていれば左向きに力を加える bool isLookRightAngle = playerComponent.wallTouchComponent.angle == PlayerHitBlockDetection.Angle.Right; jumpWallXPower = isLookRightAngle ? -jumpWallPower.x : jumpWallPower.x; // 右を向いていれば左向きに力を加える playerGravity = jumpWallPower.y; moveValue = 0.0f; // 向きを逆にする //LookAtReverseAngle(); PlayerAngle playerAngle = isLookRightAngle ? PlayerAngle.Left : PlayerAngle.Right; LookAtDesignationAngle(playerAngle); // スティック移動一定時間出来ない dontJumpWallTimer = 0.0f; playerStatePrevious = playerState; playerState = PlayerState.Jump; return(true); }
// プレイヤーの向きを変更 public void ChangeAngle() { // 移動方向が switch (moveDirection) { // 前なら case MoveDirection.FRONT: playerAngle = PlayerAngle.FRONT; // アリスの向きを前向きに transform.localEulerAngles = angleFront; // 前方向の角度を指定 break; // 後なら case MoveDirection.BACK: playerAngle = PlayerAngle.BACK; // アリスの向きを後向きに transform.localEulerAngles = angleBack; // 後方向の角度を指定 break; // 左なら case MoveDirection.LEFT: playerAngle = PlayerAngle.LEFT; // アリスの向きを左向きに transform.localEulerAngles = angleLeft; // 左方向の角度を指定 break; // 右なら case MoveDirection.RIGHT: playerAngle = PlayerAngle.RIGHT; // アリスの向きを右向きに transform.localEulerAngles = angleRight; // 右方向の角度を指定 break; } }
// 登り状態のセット public void SetClimbPosition(PlayerAngle angle) { switch (angle) { case PlayerAngle.FRONT: transform.position = new Vector3((float)arrayPosX, (float)arrayPosY - 0.5f, (float)arrayPosZ + 0.3f); break; case PlayerAngle.BACK: transform.position = new Vector3((float)arrayPosX, (float)arrayPosY - 0.5f, (float)arrayPosZ - 0.3f); break; case PlayerAngle.LEFT: transform.position = new Vector3((float)arrayPosX - 0.3f, (float)arrayPosY - 0.5f, (float)arrayPosZ); break; case PlayerAngle.RIGHT: transform.position = new Vector3((float)arrayPosX + 0.3f, (float)arrayPosY - 0.5f, (float)arrayPosZ); break; } }
// 巻き戻し public void MoveReturn() { if (saveCount > 0) { timeFlag = true; timeBackFlag = true; moveFlag = true; moveBeforePosition = transform.position; // 移動前の座標に現在の座標を入れる playerAngle = saveMovePlayerAngle[saveCount - 1]; // プレイヤーの向きに1つ前の向きを取得 moveDirection = saveMoveDirection[saveCount - 1]; // 移動方向に1つ前の移動方向を取得 // キー入力による移動の場合 if (saveMoveInput[saveCount - 1] == true) { moveCount--; ModeCheck(); ModeCountUp(); // 保存されている移動方向が switch(saveMoveDirection[saveCount - 1]) { case MoveDirection.FRONT: case MoveDirection.BACK: case MoveDirection.LEFT: case MoveDirection.RIGHT: ResetPosition(); moveBeforePosition = transform.position; SetAnimation(Motion.WALK_RETURN); ResetAnimation(Player.Motion.CLIMB1); ResetAnimation(Player.Motion.CLIMB2); break; case MoveDirection.STOP: SetAnimation(Motion.STAY_RETURN); break; } } // 移動方向が上下の場合はプレイヤーの向きを入れる if ((moveDirection == MoveDirection.UP) || (moveDirection == MoveDirection.DOWN)) { switch (playerAngle) { case PlayerAngle.FRONT: transform.localEulerAngles = angleFront; break; case PlayerAngle.BACK: transform.localEulerAngles = angleBack; break; case PlayerAngle.LEFT: transform.localEulerAngles = angleLeft; break; case PlayerAngle.RIGHT: transform.localEulerAngles = angleRight; break; } } // 移動方向が待機の場合 if (moveDirection == MoveDirection.STOP) { stopCount = 0; } ChangeAngle(); // アリスの向きを変更 moveAction = MoveAction.RETURN; // アリスの行動を戻るに saveCount--; // 最後の保存場所を変更 // 上下の反転 switch (moveDirection) { case MoveDirection.UP: moveDirection = MoveDirection.DOWN; if (animationClimb2Flag == true) { ResetAnimation(Player.Motion.CLIMB2); } break; case MoveDirection.DOWN: moveDirection = MoveDirection.UP; if (animationClimb1Flag == true) { SetAnimation(Player.Motion.CLIMB2); ResetAnimation(Player.Motion.CLIMB1); } break; } } }
public void Save(XElement e) { XElement elemGameSetting = new XElement("GameSetting"); e.Add(elemGameSetting); XElement elem = new XElement("OurTeamOffensive"); XAttribute attri = new XAttribute("Value", OurTeamOffensive.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("Scaling"); attri = new XAttribute("Value", Scaling.ToString()); elem.Add(attri); elemGameSetting.Add(elem); // 11-09-2010 Scott elem = new XElement("ScalingAnimation"); attri = new XAttribute("Value", ScalingAnimation.ToString()); elem.Add(attri); elemGameSetting.Add(elem); // 10-08-2010 Scott elem = new XElement("OffensiveMainField"); attri = new XAttribute("Value", OffensiveMainField.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("OffensiveSubField"); attri = new XAttribute("Value", OffensiveSubField.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("DefensiveMainField"); attri = new XAttribute("Value", DefensiveMainField.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("DefensiveSubField"); attri = new XAttribute("Value", DefensiveSubField.ToString()); elem.Add(attri); elemGameSetting.Add(elem); // 10-26-2011 Scott elem = new XElement("KickMainField"); attri = new XAttribute("Value", KickMainField.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("KickSubField"); attri = new XAttribute("Value", KickSubField.ToString()); elem.Add(attri); elemGameSetting.Add(elem); // end elem = new XElement("UserFolder"); attri = new XAttribute("Value", UserFolder); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("UserType"); attri = new XAttribute("Value", UserType.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("ProductType"); attri = new XAttribute("Value", ProductType.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("PlaygroundType"); attri = new XAttribute("Value", PlaygroundType.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("CurrentTheme"); attri = new XAttribute("Value", CurrentTheme); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("GridLine"); attri = new XAttribute("Value", GridLine.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("SnapValue"); attri = new XAttribute("Value", SnapValue.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("SnapToGrid"); attri = new XAttribute("Value", SnapToGrid.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("ShowBall"); attri = new XAttribute("Value", ShowBall.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("BallSize"); attri = new XAttribute("Value", BallSize.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("Landscape"); attri = new XAttribute("Value", Landscape.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("ShowPlayground"); attri = new XAttribute("Value", ShowPlayground.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("EnableColor"); attri = new XAttribute("Value", EnableColor.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("EnableSymbolColor"); attri = new XAttribute("Value", EnableSymbolColor.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("EnableTitle"); attri = new XAttribute("Value", EnableTitle.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("PlayerAngle"); attri = new XAttribute("Value", PlayerAngle.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("PlayerAppearance"); attri = new XAttribute("Value", PlayerAppearance.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("PlayerDash"); attri = new XAttribute("Value", PlayerDash.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("PlayerSzie"); attri = new XAttribute("Value", PlayerSize.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("PlayerTextVisibility"); attri = new XAttribute("Value", PlayerTextVisibility.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("PlayerThickness"); attri = new XAttribute("Value", PlayerThickness.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("ImageShowPlayground"); attri = new XAttribute("Value", ImageShowPlayground.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("ImageEnableColor"); attri = new XAttribute("Value", ImageEnableColor.ToString()); elem.Add(attri); elemGameSetting.Add(elem); elem = new XElement("ImageEnableSymbolColor"); attri = new XAttribute("Value", ImageEnableSymbolColor.ToString()); elem.Add(attri); elemGameSetting.Add(elem); }
// public PlayerDirectionIndicator dirIndicator; void Awake() { pl = this; playerAngle = GetComponent<PlayerAngle>(); Transform cha = characters.Find(character); GetComponent<MeshFilter>().sharedMesh = cha.GetComponent<MeshFilter>().sharedMesh; cha.GetChild(0).gameObject.SetActive(true); cha.GetChild(0).SetParent(transform, false); GetComponent<BoxCollider>().size = cha.GetComponent<BoxCollider>().size; }