Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active June 12, 2018 05:29
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 todorok1/f846191dcd6d64710d5397f57dd7f581 to your computer and use it in GitHub Desktop.
Save todorok1/f846191dcd6d64710d5397f57dd7f581 to your computer and use it in GitHub Desktop.
日本語でスクリプトを書いてみよう
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class 新しい振る舞いのスクリプト : MonoBehaviour {
bool 動いたかどうかのフラグ;
Vector3 フォースは我と共にあり = new Vector3(10f, 10f, 0f);
void Start(){
Debug.Log("新しい振る舞いのスクリプトが呼ばれている");
}
void FixedUpdate(){
if (Time.frameCount < 10){
return;
}
if (!動いたかどうかのフラグ){
gameObject.GetComponent<Rigidbody>().AddForce(フォースは我と共にあり, ForceMode.Impulse);
動いたかどうかのフラグ = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment