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
//攻撃アニメーションを実行 AnimeName:攻撃アニメーションの名前(string) | |
animation.CrossFade(AnimeName); | |
//遅延実行 | |
Invoke("Invoke_AttackStandy", animation[AnimeName].length / animation[AnimeName].speed - 0.1f); | |
//待機アニメーションに変更 | |
void Invoke_AttackStandy(){ | |
//BG_AttackStandy:待機アニメーションの名前 | |
animation.CrossFade("BG_AttackStandy",0.3f); |
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
public float walkSpeed = 7.0f; //歩く速度 | |
public float gravity = 10.0f;//重力加速度 | |
private Vector3 velocity;//現在の速度 | |
void Update () { | |
//CharacterControllerを取得 | |
CharacterController controller = GetComponent<CharacterController>(); | |
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
public float walkSpeed = 15.0f; //歩く速度 | |
public float gravity = 10.0f;//重力加速度 | |
private Vector3 velocity;//現在の速度 | |
void Update () { | |
//CharacterControllerを取得 | |
CharacterController controller = GetComponent<CharacterController>(); | |
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
public class PlayerController : MonoBehaviour { | |
//移動 | |
private float walkSpeed = 50.0f; //移動速度係数 | |
private float gravity = 10.0f;//重力加速度 | |
private Vector3 velocity;//現在の移動速度 | |
//回転 | |
private float RotSpeed = 90.0f; //回転速度係数 |
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
void PlayerMove(){ | |
//速度初期化 | |
velocity = Vector3.zero; | |
//キー入力確認 各キーが押されているか | |
if (Input.GetKey(KeyCode.A)){ | |
velocity -= transform.right; | |
} |
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
//タッチされている | |
if(Input.touchCount > 0){ | |
//タッチされている指の数だけループ | |
foreach ( Touch touch in Input.touches ){ | |
Camera myCamera = GameObject.Find("Camera").camera; //カメラ | |
Ray ray = myCamera.ScreenPointToRay(touch.position); //光線 | |
RaycastHit hit; //光線が当たったときの情報 | |
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
//キャラクター回転 | |
void PlayerRotation(){ | |
//回転速度 | |
float RotX = 0f , RotY = 0f; | |
/////キー入力確認 各キーが押されているか | |
if (Input.GetKey(KeyCode.LeftArrow)){ | |
RotY = -1f; |
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
//キャラクター回転 | |
void PlayerRotation(){ | |
//回転速度 | |
float RotX = 0f , RotY = 0f; | |
/////キー入力確認 各キーが押されているか | |
if (Input.GetKey(KeyCode.LeftArrow)){ | |
RotY = -1f; |
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 UnityEditor; | |
public sealed class Importer : AssetPostprocessor | |
{ | |
//returnの値が小さいほど優先される | |
public override int GetPostprocessOrder() | |
{ | |
return 0; |
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
//タッチ開始 | |
-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ | |
//メニュー画面が開いていない,操作キャラが死んでいない,ゲームが終わっていない | |
if (TopMenu.enabled && !MainPlyaer.DeathFlag && !GameOverFlag) { | |
TouchFlag = YES;//タッチ状態か否かのフラグをオン | |
//タッチ位置 | |
CGPoint TouchPos = [touch locationInView: [touch view]];//タッチされた位置 |
OlderNewer