private void Awake() { if (instance == null) { instance = this; } else if (instance == this) { Destroy(gameObject); } }
// Use this for initialization void Start() { audioSource = GetComponent <AudioSource>(); objectPool = LaserObjectPool.instance; playerToFollow = FindObjectOfType <PlayerController>().GetComponent <Collider2D>(); skeletonAnimation = GetComponent <SkeletonAnimation>(); pupil = skeletonAnimation.skeleton.FindBone(pupilBoneName); eye = skeletonAnimation.skeleton.FindBone(eyeBoneName); skeletonAnimation.AnimationState.Complete += AnimationCompleteListener; ChangeAnimation(); }