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> | |
/// SendMessageを使って対象のスクリプトの処理を呼び出します。 | |
/// </Summary> | |
public class SendMessageCaller : MonoBehaviour | |
{ | |
public GameObject targetObj; | |
void Start() | |
{ | |
targetObj.SendMessage("ShowLog"); |
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>(); | |
} | |
} |
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
int userNumber = 1234; | |
Debug.Log($"{userNumber}"); | |
// これだと変数の中身だけ表示されて「わけがわからないよ」となる | |
// 1234 | |
Debug.Log($"userNumber : {userNumber}"); | |
// これなら変数名も出力される | |
// userNumber : 1234 |
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
Assets/Images/EditorScriptSample.cs(7,35): error CS0246: The type or namespace name 'Editor' could not be found (are you missing a using directive or an assembly reference?) |
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
IEnumerator WaitSample() | |
{ | |
// 1.0秒処理を待ちます。 | |
yield return new WaitForSeconds(1.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
using UnityEngine; | |
using UnityEngine.Advertisements; | |
using UnityEngine.UI; | |
/// <Summary> | |
/// 広告のテストを行うサンプルコードです。 | |
/// </Summary> | |
public class AdSample : MonoBehaviour, IUnityAdsListener | |
{ | |
// Unity Adsを有効化した時に発行されるIDを記載します。 |
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 UnityEngine.Advertisements; | |
/// <Summary> | |
/// 広告のテストを行うサンプルコードです。 | |
/// </Summary> | |
public class AdSample : MonoBehaviour | |
{ | |
string placementId = "rewardedVideo"; |
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
developmentRegion = en; | |
hasScannedForEncodings = 1; | |
knownRegions = ( | |
English, | |
en, | |
ja, | |
"ja-JP", | |
); |
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
developmentRegion = English; | |
hasScannedForEncodings = 1; | |
knownRegions = ( | |
English, | |
en, | |
ja, | |
"ja-JP", | |
); |
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
developmentRegion = English; | |
hasScannedForEncodings = 1; | |
knownRegions = ( | |
English, | |
Japanese, | |
French, | |
German, | |
en, | |
); |