Example #1
0
    void Start()
    {
        if (_collider == null)
        {
            throw new NullReferenceException("Collider cannot be null!");
        }

        _cam = GlobalCamera.instance;
        _collider.isTrigger = true;
    }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #3
0
 void Awake()
 {
     instance = this;
 }
Example #4
0
 private void Awake()
 {
     instance = this;
     camera   = GetComponent <Camera>();
 }