void Start() { EnergyHandler.AddEnergyObject(this); rb = GetComponent <Rigidbody>(); groundChecker = GetComponentInChildren <GroundChecker>(); sM = new PickGoatStateMachine(this); SendMessage("GetFSM", sM); audioSource = GetComponent <AudioSource>(); }
private void GetFSM(PickGoatStateMachine fSM) { pSM = fSM; pSM.OnTransitionEvent += CatchStateChange; }