Пример #1
0
 void Awake()
 {
     if (rubiControl == null) {
         DontDestroyOnLoad (gameObject);
         rubiControl = this;
     } else if (rubiControl != this) {
         Destroy(gameObject);
     }
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     currInvuln = false;
     playerMovement = RubiControllerScript.rubiControl.GetComponent <RubiControllerScript> ();
     playerSprite = RubiControllerScript.rubiControl.GetComponent <SpriteRenderer> ();
     anim = RubiControllerScript.rubiControl.GetComponent <Animator> ();
     playerMovement.enabled = true;
 }