mirror of
https://github.com/ConjureETS/OuijaMTLGJ2016.git
synced 2026-03-26 03:01:06 +00:00
fix scrapping sound volume jumping around
use a lerp to smooth volume adjustments
This commit is contained in:
parent
c4a88873e2
commit
2523ce3680
@ -2396,7 +2396,7 @@ Prefab:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 10833872, guid: 09a2e2e70f49c4330831bd4f733bbdb4, type: 2}
|
- target: {fileID: 10833872, guid: 09a2e2e70f49c4330831bd4f733bbdb4, type: 2}
|
||||||
propertyPath: m_Range
|
propertyPath: m_Range
|
||||||
value: 252.96521
|
value: 265.97876
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 169668, guid: 09a2e2e70f49c4330831bd4f733bbdb4, type: 2}
|
- target: {fileID: 169668, guid: 09a2e2e70f49c4330831bd4f733bbdb4, type: 2}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
@ -2410,6 +2410,10 @@ Prefab:
|
|||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: Spotlight_blue (right)
|
value: Spotlight_blue (right)
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 437796, guid: 09a2e2e70f49c4330831bd4f733bbdb4, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: -2.32999992
|
||||||
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: 09a2e2e70f49c4330831bd4f733bbdb4, type: 2}
|
m_ParentPrefab: {fileID: 100100000, guid: 09a2e2e70f49c4330831bd4f733bbdb4, type: 2}
|
||||||
m_IsPrefabParent: 0
|
m_IsPrefabParent: 0
|
||||||
|
|||||||
@ -21,6 +21,7 @@ public class LevelManager : MonoBehaviour {
|
|||||||
|
|
||||||
private SelectorWithBolts Selector;
|
private SelectorWithBolts Selector;
|
||||||
private GameObject PhysicsContainer;
|
private GameObject PhysicsContainer;
|
||||||
|
private int playerId;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start()
|
void Start()
|
||||||
@ -83,9 +84,11 @@ public class LevelManager : MonoBehaviour {
|
|||||||
{
|
{
|
||||||
if (player.hasNextLetter(letterNum))
|
if (player.hasNextLetter(letterNum))
|
||||||
{
|
{
|
||||||
tile.symbol.color = PlayerColors[player.num - 1];
|
playerId = player.num - 1;
|
||||||
StartCoroutine(MoveSelectorToTile(tile));
|
|
||||||
|
|
||||||
|
tile.symbol.color = PlayerColors[playerId];
|
||||||
|
StartCoroutine(MoveSelectorToTile(tile));
|
||||||
|
|
||||||
SoundManager.Instance.PlayRunePickup();
|
SoundManager.Instance.PlayRunePickup();
|
||||||
|
|
||||||
//Do something
|
//Do something
|
||||||
@ -154,7 +157,7 @@ public class LevelManager : MonoBehaviour {
|
|||||||
Vector3 endPos = cameraTrans.position + cameraTrans.forward * 10f;//trans.position + new Vector3(0f, 5f, 0f);
|
Vector3 endPos = cameraTrans.position + cameraTrans.forward * 10f;//trans.position + new Vector3(0f, 5f, 0f);
|
||||||
Quaternion endRot = Quaternion.LookRotation(cameraTrans.forward);
|
Quaternion endRot = Quaternion.LookRotation(cameraTrans.forward);
|
||||||
|
|
||||||
ratio += Time.deltaTime / 2f;
|
ratio += Time.deltaTime / 1.5f;
|
||||||
|
|
||||||
trans.position = Vector3.Lerp(startPos, endPos, ratio);
|
trans.position = Vector3.Lerp(startPos, endPos, ratio);
|
||||||
trans.rotation = Quaternion.Slerp(startRot, endRot, ratio);
|
trans.rotation = Quaternion.Slerp(startRot, endRot, ratio);
|
||||||
@ -179,9 +182,11 @@ public class LevelManager : MonoBehaviour {
|
|||||||
float ratio = 0f;
|
float ratio = 0f;
|
||||||
while (ratio < 1f)
|
while (ratio < 1f)
|
||||||
{
|
{
|
||||||
ratio += Time.deltaTime / 0.5f;
|
ratio += Time.deltaTime / 1f;
|
||||||
|
|
||||||
Vector3 endPos = Camera.main.ViewportToWorldPoint(new Vector3(0.9f, 0.9f, Camera.main.nearClipPlane + 0.1f));
|
float viewportX = 0.2f + playerId * 0.3f;
|
||||||
|
|
||||||
|
Vector3 endPos = Camera.main.ViewportToWorldPoint(new Vector3(viewportX, 0.8f, Camera.main.nearClipPlane + 0.1f));
|
||||||
|
|
||||||
trans.position = Vector3.Lerp(startPos, endPos, ratio);
|
trans.position = Vector3.Lerp(startPos, endPos, ratio);
|
||||||
trans.localScale = Vector3.Lerp(startScale, endScale, ratio);
|
trans.localScale = Vector3.Lerp(startScale, endScale, ratio);
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public class SelectorWithBolts : MonoBehaviour
|
|||||||
playerCylinders[i] = Ropes[i].GetComponent<Transform>().GetComponentsInChildren<MeshRenderer>();
|
playerCylinders[i] = Ropes[i].GetComponent<Transform>().GetComponentsInChildren<MeshRenderer>();
|
||||||
}
|
}
|
||||||
|
|
||||||
sm = SoundManager.Instance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
@ -40,6 +40,8 @@ public class SelectorWithBolts : MonoBehaviour
|
|||||||
{
|
{
|
||||||
ReplenishPlayerDashMeter(i);
|
ReplenishPlayerDashMeter(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sm = SoundManager.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
|
|||||||
@ -53,9 +53,9 @@ public class SoundManager : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateScrappingVolume( float volume)
|
public void UpdateScrappingVolume( float newVolume)
|
||||||
{
|
{
|
||||||
Scrapping.volume = volume;
|
Scrapping.volume = Mathf.Lerp(Scrapping.volume, newVolume, Time.deltaTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user