private void Start() { collectionDisplayBG.enabled = false; sheep = GetComponent <Sheep>(); sheepSelectable = sheep.ThisSelectable; sheepSelectable.onThisMouseEnter += () => collectionDisplayBG.enabled = true; sheepSelectable.onThisMouseExit += () => collectionDisplayBG.enabled = false; sheepSelectable.onThisSelected += () => StartCoroutine(BeingCollectedCoroutine()); sheepSelectable.onThisDisabled += () => collectionDisplayBG.enabled = false; }
private void Awake() { animator = GetComponent <Animator>(); ThisSelectable = GetComponentInChildren <Selectable>(); sheepLight = GetComponentInChildren <Light2D>(); waitWhileShearing = new WaitForSeconds(sheepSettings.fillTime); noiseVar = new Vector2(Random.value, Random.value); sheepLight.enabled = false; PlayerController.PlayerSettings.onManaChange.Register(gameObject, o => RefreshSelectable()); RandomizeAnimationSpeed(); }