Exemple #1
0
        void Start()
        {
            //initialization
            rb2d     = GetComponent <Rigidbody2D>();
            myCamera = Camera.main.gameObject;
            Assert.IsNotNull(myCamera);
            audioManager = AudioManager.instance;
            Assert.IsNotNull(audioManager);
            speedSwitch  = 1;
            _moveSpeed   = moveSpeed[speedSwitch];
            speedManager = SpeedManager.instance;

            StartCoroutine(Invincibility(this.gameObject));
        }
Exemple #2
0
 private void Awake()
 {
     if (instance != null)
     {
         if (instance != this)
         {
             Destroy(gameObject);
         }
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
 }