Created
August 10, 2020 09:35
-
-
Save todorok1/f294a066b7e1b06fc045cc9c43360036 to your computer and use it in GitHub Desktop.
nullチェックをするコードのサンプル
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
/// <Summary> | |
/// AudioSourceへの参照がセットされているか確認する処理です。 | |
/// </Summary> | |
void CheckAudioReference() | |
{ | |
if (bgmAudio == null) | |
{ | |
bgmAudio = gameObject.GetComponent<AudioSource>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment