// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Debug.Log("SampoStart OnStateExit called."); Sampo _sampo = FindObjectOfType <Sampo>(); _sampo.ChangeState(Sampo.SampoStateType.Idle); }
public void Init(SampoProductType sampoProductType, Sampo sampo, Vector3 spawnPosition) { _sampoProductType = sampoProductType; _sampo = sampo; transform.position = spawnPosition; _fadeOutTimeModified = _fadeOutTimeBase + Random.Range(-_startFadingOutTimeVariance, _startFadingOutTimeVariance); _fadeOutTimeCountdown = _fadeOutTimeModified; GetComponent <Renderer>().material.color = _originalColor; _newColor = _originalColor; _startFadingOutTimeCounter = 0f; }