-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65c5042
commit fcb83fa
Showing
9 changed files
with
107 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class BackMirrorAnchor : MonoBehaviour { | ||
|
||
public Transform CameraPos; | ||
public Transform LowerTarget; | ||
Vector3 InitalUpperPosition; | ||
public float minIn; // min and max y CameraPos local position height | ||
public float maxIn; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
InitalUpperPosition = transform.localPosition; | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
if (SceneStateManager.Instance.ActionState != ActionState.DRIVE) | ||
{ | ||
float lerpValue = Mathf.Lerp(0, 1, ((CameraPos.localPosition.y - minIn) / (maxIn - minIn))); | ||
; transform.localPosition = Vector3.Lerp(LowerTarget.localPosition, InitalUpperPosition, lerpValue); | ||
Debug.Log(lerpValue); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.