private void Start() { genEnemy = GetComponent <GeneralEnemy>(); playerController = GameObject.FindObjectOfType <SAYController>(); rb = GetComponent <Rigidbody2D>(); sr = GetComponentInChildren <SpriteRenderer>(); animator = GetComponentInChildren <Animator>(); activeSpeed = Speed; //currentState = SlimeStates.Jump; Player = GameObject.FindGameObjectWithTag("Player").transform; counter = TimeToMove; matDefault = sr.material; }
private void Awake() { instance = this; DontDestroyOnLoad(gameObject); }