Beispiel #1
0
    void FixedUpdate()
    {
        mHorz = mRandNum.Next(-10, 10);
        mVert = mRandNum.Next(-10, 10);

        mRandomDir.Set(mHorz, mVert);
        mPlayerMovment.movePlayer(mRandomDir);
    }
Beispiel #2
0
    void FixedUpdate()
    {
        mDist = Vector2.Distance(mPlayerMovment.mRigidPlayer.position, mPathThroughDungeon[mNextIndex]);
        if (mDist < mMinDist)
        {
            mNextIndex++;
        }

        mWaypointDir = (mPathThroughDungeon[mNextIndex] - mPlayerMovment.mRigidPlayer.position);
        mPlayerMovment.movePlayer(mWaypointDir);
    }