Skip to content

Instantly share code, notes, and snippets.

@kentouemura
Created March 14, 2016 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentouemura/78aada2943f23fc8ed1e to your computer and use it in GitHub Desktop.
Save kentouemura/78aada2943f23fc8ed1e to your computer and use it in GitHub Desktop.
プレイヤークラス
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