private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(instance); } else { Destroy(gameObject); } }
// Update is called once per frame void Update() { OriginPoint = GameObject.FindGameObjectWithTag("OriginPoint").GetComponent <Transform>(); pRef = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>(); powerButton = GameObject.FindGameObjectWithTag("PBUI").GetComponent <Image>(); dpadRef = GameObject.FindGameObjectWithTag("DpadController").GetComponent <DpadController>(); pRef.AttackPower = PlayerAttackPower; PowerCoreCollect(); PositiveAlignment(); NegativeAlignment(); }
void OnDestroy() { _instance = null; }
void Awake() { _instance = this; }