Created
June 30, 2018 08:07
-
-
Save todorok1/23bfc9ff4e02c9cf4f53e7cbcecf355e to your computer and use it in GitHub Desktop.
RequireComponentは自作スクリプトでも有効
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
[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