PlayerPhysics.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        if(pushPosition != Vector3.zero)
        {
            transform.position = (pushPosition - transform.position)*0.02f + transform.position;
        }
    }

Usage Example

示例#1
0
文件: GameMain.cs 项目: vthem/Tubular
    void Update()
    {
        if (landGenerator == null)
        {
            landGenerator = new LandGenerator(config);
        }
        landGenerator.Update();

        if (objectSpawner == null)
        {
            objectSpawner = new ObjectSpawner(config);
        }
        objectSpawner.Update();

        if (playerPhysics == null)
        {
            playerPhysics = new PlayerPhysics(playerObject, config);
        }
        playerPhysics.Update();

        if (cameraFollowPlayer == null)
        {
            cameraFollowPlayer = new CameraFollowPlayer(() => playerObject.transform, () => Camera.main.transform, config);
        }
        cameraFollowPlayer.Update();
    }