//---------------------------------------------------------------------------------------------------- // Behavior - Eating //---------------------------------------------------------------------------------------------------- public void Eat( CornStalk corn ) { mCurrentCornStalk = corn; mStateMachine.ChangeState( CrowStates.Eating ); }
public override void Enter() { Debug.Log("FlyingToCorn:Enter"); // switch to the calm flying sprite mCrow.SwitchSprite( "Sprite_Calm" ); // pick a corn stalk pos mTargetCorn = PickCornStalk(); // set the landing position (offset from corn transform) mTargetCornLandPos = mTargetCorn.transform.position + new Vector3(0f, 0.9f, -0.7f); // face the direction we're going mCrow.SwitchFacing( mCrow.transform.position.z > mTargetCorn.transform.position.z ); }