コード例 #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
コード例 #2
0
 private void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     camera = GetComponent <Camera>();
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     RedPlayerLight   = GameObject.Find("RedCharacter").GetComponent <LightChecker>();
     BluePlayerLight  = GameObject.Find("BlueCharacter").GetComponent <LightChecker>();
     GreenPlayerLight = GameObject.Find("GreenCharacter").GetComponent <LightChecker>();
 }