private void Awake() { inputState = GetComponent <InPutState>(); walkBehavior = GetComponent <Walk>(); animator = GetComponent <Animator>(); }
void OnButtonClick(Button _button) { if( !mIsCopy ) { if ( _button == mButtonTop ) { if(mTrack.isValidCheck( InPutState.Up)) { mInPutState = InPutState.Up; } } else if ( _button == mButtonMiddle ) { if(mTrack.isValidCheck( InPutState.Middle)) { mInPutState = InPutState.Middle; } } else if ( _button == mButtonDown ) { if(mTrack.isValidCheck( InPutState.Down)) { mInPutState = InPutState.Down; } } Play(0,false); } }
protected virtual void Awake() { inputState = GetComponent <InPutState>(); body2d = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); }
// Use this for initialization void Start() { body2d = GetComponent <Rigidbody2D>(); inputState = GetComponent <InPutState>(); }