public override void UpdateMovement(Vector3 playerPosition)
        {
            if (CurrentFlower != null && !CurrentFlowerHasMoved)
            {
                if (!Friendly && (Vector3.Distance(playerPosition, mCurrentPosition) < StartleThreshold) && !Player.Local.IsCrouching)
                {
                    CurrentFlower    = null;
                    RestingOnFlower  = false;
                    WaitingForFlower = false;
                    rb.isKinematic   = false;
                    base.UpdateMovement(playerPosition);
                    StartleTimeEnd = WorldClock.AdjustedRealTime + RestOnFlowerTime;
                    return;
                }

                if (RestingOnFlower)
                {
                    if (WorldClock.AdjustedRealTime < (TimeStartedResting + RestOnFlowerTime))
                    {
                        //wait on the flower and don't apply forces
                        //rb.isKinematic = true;
                        //move it spot onto the flower
                        rb.isKinematic   = true;
                        mCurrentPosition = Vector3.Lerp(mCurrentPosition, mRandomFlowerPosition, 0.125f);
                        rb.MovePosition(mCurrentPosition);
                    }
                    else
                    {
                        //done!
                        rb.isKinematic   = false;
                        RestingOnFlower  = false;
                        WaitingForFlower = false;
                        if (CurrentFlower != null && CurrentFlower.OccupyingCritter == this)
                        {
                            CurrentFlower.OccupyingCritter = null;
                        }
                        LastFlower    = CurrentFlower;
                        CurrentFlower = null;
                        base.UpdateMovement(playerPosition);
                    }
                }
                else
                {
                    //move towards the flower
                    rb.isKinematic = false;
                    if (FlyTowardsFlower(playerPosition, WaitingForFlower))
                    {
                        //if we're close enough to land next frame we'll go kinematic
                        RestingOnFlower    = true;
                        TimeStartedResting = WorldClock.AdjustedRealTime;
                    }
                }
            }
            else
            {
                rb.isKinematic = false;
                //set it to null in case it's just inactive
                RestingOnFlower = false;
                //rb.isKinematic = false;
                base.UpdateMovement(playerPosition);
            }
        }
        protected IEnumerator FindFlowersOverTime()
        {
            //give ourselves a second before looking for a flower
            double waitUntil = WorldClock.AdjustedRealTime + 1f;

            while (WorldClock.AdjustedRealTime < waitUntil && !mDestroyed)
            {
                yield return(null);
            }

            while (!mDestroyed)
            {
                while (RestingOnFlower)
                {
                    //don't get a flower we're not resting on
                    yield return(null);
                }

                while (WorldClock.AdjustedRealTime < StartleTimeEnd)
                {
                    yield return(null);
                }

                while (CurrentFlower == null)
                {
                    //find something between the player and the critter, closer if it's friendlier
                    if (Plants.Get.NearestFloweringPlant(Player.Local.Position, 5f, LastFlower, ref CurrentFlower))                       //, mCurrentPosition, Friendly ? 0.1f : 0.8f), 4f, LastFlower, ref CurrentFlower)) {
                    {
                        mCurrentFlowerPosition = CurrentFlower.worlditem.Position;
                        mRandomFlowerPosition  = CurrentFlower.GetRandomFlowerPosition();
                        //wait by default, we'll find out if we can occupy it later
                        WaitingForFlower = true;
                        mMaxWaitTime     = WorldClock.AdjustedRealTime + (RestOnFlowerTime * 2);
                    }
                    else
                    {
                        waitUntil = WorldClock.AdjustedRealTime + 0.5f;
                        while (WorldClock.AdjustedRealTime < waitUntil && !mDestroyed)
                        {
                            yield return(null);
                        }
                    }
                }

                while (WaitingForFlower)
                {
                    if (CurrentFlowerHasMoved)
                    {
                        //whoops, we'll have to start over again
                        CurrentFlower    = null;
                        WaitingForFlower = false;
                        yield return(null);
                    }
                    else
                    {
                        //see if it's occupied
                        if (!CurrentFlower.IsOccupied)
                        {
                            CurrentFlower.OccupyingCritter = this;
                            WaitingForFlower = false;
                            yield return(null);
                        }
                        else
                        {
                            if (WorldClock.AdjustedRealTime > mMaxWaitTime)
                            {
                                WaitingForFlower = false;
                                CurrentFlower    = null;
                            }
                            else
                            {
                                waitUntil = WorldClock.AdjustedRealTime + (Random.value * 0.5f) + 0.1f;
                                while (WorldClock.AdjustedRealTime < waitUntil && !mDestroyed)
                                {
                                    yield return(null);
                                }
                            }
                        }
                    }
                }

                waitUntil = WorldClock.AdjustedRealTime + 0.5f;
                while (WorldClock.AdjustedRealTime < waitUntil && !mDestroyed)
                {
                    yield return(null);
                }
                yield return(null);
            }
        }