Created
March 14, 2016 15:25
-
-
Save kentouemura/78aada2943f23fc8ed1e to your computer and use it in GitHub Desktop.
プレイヤークラス
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
/// <summary> | |
/// プレイヤークラス | |
/// </summary> | |
public class Player : CharacterBase | |
{ | |
/// <summary> | |
/// プレイヤーの移動速度 | |
/// </summary> | |
readonly float PLAYER_SPEED = 0.05F; | |
/// <summary> | |
/// 初期化 | |
/// </summary> | |
public override void Start() | |
{ | |
} | |
/// <summary> | |
/// 移動 | |
/// </summary> | |
public override void Move() | |
{ | |
var moveDirection = Input.GetAxis("Horizontal"); | |
var pos = this.transform.localPosition; | |
pos.x += (moveDirection * PLAYER_SPEED); | |
this.transform.localPosition = pos; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment