void Awake() { if (rubiControl == null) { DontDestroyOnLoad (gameObject); rubiControl = this; } else if (rubiControl != this) { Destroy(gameObject); } }
// 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; }