Inheritance: MonoBehaviour
コード例 #1
0
 // Use this for initialization
 void Awake()
 {
     aud = GetComponent <AudioSource>();
     DontDestroyOnLoad(gameObject);
     anim     = GetComponent <Animator>();
     Instance = this;
 }
コード例 #2
0
 void Update()
 {
     if (playerObj == null)
     {
         playerObj = GameObject.FindGameObjectWithTag("player").GetComponent <Player>();
     }
     if (hudObj == null)
     {
         hudObj = GameObject.FindGameObjectWithTag("UI").GetComponent <hud>();
     }
     if (ldScrn == null)
     {
         ldScrn = GameObject.FindGameObjectWithTag("LdScrn").GetComponent <loadingScreen>();
     }
 }