-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added main menu and intro cinematic. Added brief pause on punctuation…
… to dialogue animations. SFX_Player_Talk_1 was changed to remove a pop at the end of the audio.
- Loading branch information
1 parent
dce2435
commit 1b1d811
Showing
21 changed files
with
4,869 additions
and
560 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,54 @@ | ||
using System; | ||
using UnityEngine; | ||
|
||
public sealed class BirdFlyInAnimation : MonoBehaviour | ||
{ | ||
public Transform Visuals; | ||
public Transform Destination; | ||
|
||
public FollowPlayer CameraController; | ||
|
||
private Vector3 Velocity = Vector3.zero; | ||
public float PositionSmoothing = 0.15f; | ||
public float OrientationSmoothing = 2f; | ||
|
||
private float TotalDistance; | ||
private Action FinishAction; | ||
|
||
public float CameraEnableDistancePercent = 0.9f; | ||
|
||
public AudioClip TreeRustleSound; | ||
public float TreeRustleTimer = 0.1f; | ||
|
||
public void StartAnimation(Action finishAction) | ||
{ | ||
enabled = true; | ||
TotalDistance = (Destination.position - transform.position).magnitude; | ||
FinishAction = finishAction; | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (TreeRustleTimer > 0f) | ||
{ | ||
TreeRustleTimer -= Time.deltaTime; | ||
if (TreeRustleTimer <= 0f) | ||
SoundEffectsController.Instance.PlayUiSound(TreeRustleSound); //TODO: Don't use UI sounds for this | ||
} | ||
|
||
transform.position = Vector3.SmoothDamp(transform.position, Destination.position, ref Velocity, PositionSmoothing); | ||
Visuals.rotation = Quaternion.Slerp(Visuals.rotation, Destination.rotation, OrientationSmoothing * Time.deltaTime); | ||
|
||
float distanceRemaining = (Destination.position - transform.position).magnitude; | ||
if (distanceRemaining < TotalDistance * (1f - CameraEnableDistancePercent) && !CameraController.enabled) | ||
{ | ||
CameraController.enabled = true; | ||
} | ||
else if (distanceRemaining < 0.01f) | ||
{ | ||
CameraController.enabled = true; | ||
FinishAction?.Invoke(); | ||
enabled = false; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.