Created
July 28, 2016 12:09
-
-
Save tsubaki/8cc88c45cb61702911851d81a3c41cf8 to your computer and use it in GitHub Desktop.
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 System.Collections; | |
using UnityEngine.Assertions; | |
public class Spawn : MonoBehaviour | |
{ | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] | |
static void Init() | |
{ | |
// 凄い重要なオブジェクトの生成して、staticに登録 | |
var sio = Resources.Load ("sugoi juyou na obujekuto") as GameObject; | |
sioi = GameObject.Instantiate (sio); | |
} | |
static GameObject sioi = null; | |
void Awake() | |
{ | |
Assert.IsNotNull (sioi); // Initが値を設定したのでnullではない(2周めは知らない) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment