// Singleton
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     magnetism = MagnetismEffect.instance;
     rb        = GetComponent <Rigidbody>();
 }