Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created June 30, 2018 08:07
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/23bfc9ff4e02c9cf4f53e7cbcecf355e to your computer and use it in GitHub Desktop.
Save todorok1/23bfc9ff4e02c9cf4f53e7cbcecf355e to your computer and use it in GitHub Desktop.
RequireComponentは自作スクリプトでも有効
[RequireComponent(typeof(RequiredCharacterStatus))]
public class RequireCharacterComponent : MonoBehaviour {
RequiredCharacterStatus status;
void Start(){
status = gameObject.GetComponent<RequiredCharacterStatus>();
}
void Update(){
Debug.Log("キャラクターのHP : " + status.hp);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment