예제 #1
0
    private void Update()
    {
        if (originalDirection == Vector3.zero && aditionalSpeedEnabled)
        {
            originalDirection = gameSceneController.getRoomDirectionAsVector();
        }
        Vector3 translateBy = -1 * gameSceneController.roomSpeed * gameSceneController.getRoomDirectionAsVector() * Time.deltaTime;

        if (aditionalSpeedEnabled)
        {
            translateBy += originalDirection * aditionalSpeed * Time.deltaTime;
        }
        transform.Translate(translateBy, Space.World);
    }
예제 #2
0
 private void Update()
 {
     transform.Translate(-1 * gameSceneController.getRoomDirectionAsVector() * gameSceneController.roomSpeed * Time.deltaTime, Space.World);
 }