Bug fixes, Scene changes and new features #376
|
@ -1,3 +1,3 @@
|
||||||
Name: Level1Scene
|
Name: Level1
|
||||||
ID: 96668835
|
ID: 96668835
|
||||||
Type: 5
|
Type: 5
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,3 @@
|
||||||
Name: MainGame
|
Name: Level2
|
||||||
ID: 86098106
|
ID: 86098106
|
||||||
Type: 5
|
Type: 5
|
|
@ -50,8 +50,11 @@ public class Breakable : Script
|
||||||
if (rb.LinearVelocity.GetSqrMagnitude() > threshHold && !info.GameObject.GetScript<PlayerController>())
|
if (rb.LinearVelocity.GetSqrMagnitude() > threshHold && !info.GameObject.GetScript<PlayerController>())
|
||||||
{
|
{
|
||||||
isBreak = true;
|
isBreak = true;
|
||||||
if(GameObject.GetScript<Item>())
|
if (GameObject.GetScript<Item>())
|
||||||
|
{
|
||||||
GameManager.Instance.totalItemCount -= 1;
|
GameManager.Instance.totalItemCount -= 1;
|
||||||
|
GameManager.Instance.itemShatter = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected override void onTriggerEnter(CollisionInfo info)
|
protected override void onTriggerEnter(CollisionInfo info)
|
||||||
|
@ -71,6 +74,7 @@ public class Breakable : Script
|
||||||
gO.Parent = GameObject.Null;
|
gO.Parent = GameObject.Null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameManager.Instance.itemShatter = false;
|
||||||
isBreak = false;
|
isBreak = false;
|
||||||
AudioHandler.audioClipHandlers["SFXBreak"].Play();
|
AudioHandler.audioClipHandlers["SFXBreak"].Play();
|
||||||
GameObject.SetActive(false);
|
GameObject.SetActive(false);
|
||||||
|
|
|
@ -28,13 +28,20 @@ public class PickAndThrow : Script
|
||||||
public bool throwItem = false;
|
public bool throwItem = false;
|
||||||
private Vector3 prevTargetOffSet;
|
private Vector3 prevTargetOffSet;
|
||||||
|
|
||||||
|
public GameObject silhouettePlayer;
|
||||||
|
public Renderable silhouettePlayerRend;
|
||||||
|
public GameObject silhouetteBag;
|
||||||
|
public Renderable silhouetteBagRend;
|
||||||
|
|
||||||
[Tooltip("Lenght of ray")]
|
[Tooltip("Lenght of ray")]
|
||||||
public float rayDistance = 1;
|
public float rayDistance = 1;
|
||||||
|
|
||||||
[Tooltip("Height of ray")]
|
[Tooltip("Height of ray")]
|
||||||
public float rayHeight = 0.1f;
|
public float rayHeight = 0.1f;
|
||||||
|
|
||||||
|
[Tooltip("FOV when you aim")]
|
||||||
public float aimingFOV = 50;
|
public float aimingFOV = 50;
|
||||||
|
[Tooltip("Default FOV")]
|
||||||
public float defaultFOV = 45;
|
public float defaultFOV = 45;
|
||||||
|
|
||||||
protected override void awake()
|
protected override void awake()
|
||||||
|
@ -51,6 +58,16 @@ public class PickAndThrow : Script
|
||||||
if(!tpc)
|
if(!tpc)
|
||||||
Debug.LogError("TPC EMPTY");
|
Debug.LogError("TPC EMPTY");
|
||||||
|
|
||||||
|
if(!silhouettePlayer)
|
||||||
|
Debug.LogError("silhouettePlayer EMPTY");
|
||||||
|
else
|
||||||
|
silhouettePlayerRend = silhouettePlayer.GetComponent<Renderable>();
|
||||||
|
|
||||||
|
if (!silhouetteBag)
|
||||||
|
Debug.LogError("silhouetteBag EMPTY");
|
||||||
|
else
|
||||||
|
silhouetteBagRend = silhouettePlayer.GetComponent<Renderable>();
|
||||||
|
|
||||||
AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw");
|
AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw");
|
||||||
|
|
||||||
timer = delayTimer;
|
timer = delayTimer;
|
||||||
|
@ -62,6 +79,18 @@ public class PickAndThrow : Script
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (silhouettePlayerRend && silhouetteBagRend)
|
||||||
|
{
|
||||||
|
//wait for daniel
|
||||||
|
//0.00075f;
|
||||||
|
/* Vector3 dis = Camera.GetMainCamera().Position - GameObject.GetComponent<Transform>().LocalPosition;
|
||||||
|
float disSqr = dis.GetSqrMagnitude();
|
||||||
|
Debug.Log($"DIS :{disSqr}");
|
||||||
|
float ratio = System.Math.Clamp(1 - (disSqr / (1 + disSqr)), 0, 1.0f);
|
||||||
|
silhouettePlayerRend.Material.SetProperty<float>("data.offset", ratio * 0.00075f);
|
||||||
|
silhouetteBagRend.Material.SetProperty<float>("data.offset", ratio * 0.00075f);*/
|
||||||
|
}
|
||||||
|
|
||||||
if (timer <= delayTimer)
|
if (timer <= delayTimer)
|
||||||
timer += Time.DeltaTimeF;
|
timer += Time.DeltaTimeF;
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,28 @@ public class GameManager : Script
|
||||||
|
|
||||||
public bool GamePause { get; set; }
|
public bool GamePause { get; set; }
|
||||||
|
|
||||||
|
public bool itemShatter { get; set; }
|
||||||
|
|
||||||
|
protected override void awake()
|
||||||
|
{
|
||||||
|
if (Instance != null && Instance != this)
|
||||||
|
RemoveScript<GameManager>();
|
||||||
|
else
|
||||||
|
Instance = this;
|
||||||
|
|
||||||
|
totalItemCount = 0;
|
||||||
|
Score = 0;
|
||||||
|
currGameState = GameState.START;
|
||||||
|
itemScored = false;
|
||||||
|
currMultiplierCombo = 1;
|
||||||
|
currMultiplierDuration = 0;
|
||||||
|
fontScalar = new Vector3(multiplierFont / maxMultiplierDuration, multiplierFont / maxMultiplierDuration , multiplierFont / maxMultiplierDuration);
|
||||||
|
itemShatter = false;
|
||||||
|
|
||||||
|
AudioHandler.audioClipHandlers["BGMWin"] = Audio.CreateAudioClip("event:/Music/stingers/game_win");
|
||||||
|
AudioHandler.audioClipHandlers["BGMLose"] = Audio.CreateAudioClip("event:/Music/stingers/game_lose");
|
||||||
|
}
|
||||||
|
|
||||||
protected override void start()
|
protected override void start()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -57,31 +79,6 @@ public class GameManager : Script
|
||||||
AudioHandler.audioClipHandlers["SFXHumming"].Play();
|
AudioHandler.audioClipHandlers["SFXHumming"].Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void awake()
|
|
||||||
{
|
|
||||||
if (Instance != null && Instance != this)
|
|
||||||
RemoveScript<GameManager>();
|
|
||||||
else
|
|
||||||
Instance = this;
|
|
||||||
|
|
||||||
|
|
||||||
//AudioHandler.audioClipHandlers["BGMAdaptive"].SetParameter("Detected", 0.0f);
|
|
||||||
//Audio.PlayBGMOnce2D("event:/Music/player_undetected");
|
|
||||||
|
|
||||||
//Audio.PlayBGMOnce2D("event:/Ambience/roomtone_kitchen");
|
|
||||||
|
|
||||||
totalItemCount = 0;
|
|
||||||
Score = 0;
|
|
||||||
currGameState = GameState.START;
|
|
||||||
itemScored = false;
|
|
||||||
currMultiplierCombo = 1;
|
|
||||||
currMultiplierDuration = 0;
|
|
||||||
fontScalar = new Vector3(multiplierFont / maxMultiplierDuration, multiplierFont / maxMultiplierDuration , multiplierFont / maxMultiplierDuration);
|
|
||||||
|
|
||||||
AudioHandler.audioClipHandlers["BGMWin"] = Audio.CreateAudioClip("event:/Music/stingers/game_win");
|
|
||||||
AudioHandler.audioClipHandlers["BGMLose"] = Audio.CreateAudioClip("event:/Music/stingers/game_lose");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void update()
|
protected override void update()
|
||||||
{
|
{
|
||||||
if (GamePause)
|
if (GamePause)
|
||||||
|
@ -116,24 +113,20 @@ public class GameManager : Script
|
||||||
multiplierText.GetComponent<Transform>().LocalScale = Vector3.Zero;
|
multiplierText.GetComponent<Transform>().LocalScale = Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((timer > 0 && totalItemCount <= 0) || Input.GetKeyDown(Input.KeyCode.F1))
|
if ((timer > 0 && totalItemCount <= 0 && !itemShatter) || Input.GetKeyDown(Input.KeyCode.F1))
|
||||||
{
|
{
|
||||||
currGameState = GameState.WIN;
|
currGameState = GameState.WIN;
|
||||||
//Audio.StopAllSounds(); //Calling this outright breaks audio clip handlers
|
|
||||||
AudioHandler.stopAllSounds(false);
|
AudioHandler.stopAllSounds(false);
|
||||||
AudioHandler.audioClipHandlers["BGMWin"].Play();
|
AudioHandler.audioClipHandlers["BGMWin"].Play();
|
||||||
SceneManager.ChangeScene(winScene);
|
SceneManager.ChangeScene(winScene);
|
||||||
//Audio.PlaySFXOnce2D("event:/Music/stingers/game_win");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(timer < 0 || Input.GetKeyDown(Input.KeyCode.F2))
|
else if(timer < 0 || Input.GetKeyDown(Input.KeyCode.F2))
|
||||||
{
|
{
|
||||||
currGameState = GameState.LOSE;
|
currGameState = GameState.LOSE;
|
||||||
//Audio.StopAllSounds();
|
|
||||||
AudioHandler.stopAllSounds(false);
|
AudioHandler.stopAllSounds(false);
|
||||||
AudioHandler.audioClipHandlers["BGMLose"].Play();
|
AudioHandler.audioClipHandlers["BGMLose"].Play();
|
||||||
SceneManager.ChangeScene(loseScene);
|
SceneManager.ChangeScene(loseScene);
|
||||||
//Audio.PlaySFXOnce2D("event:/Music/stingers/game_lose");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
struct MatPropData
|
struct MatPropData
|
||||||
{
|
{
|
||||||
vec4 color;
|
vec4 color;
|
||||||
|
float offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GenericData
|
struct GenericData
|
||||||
|
@ -56,7 +57,7 @@ layout(input_attachment_index = 0, set = 3, binding = 0) uniform subpassInput de
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
// Sample depth buffer using UV and save it
|
// Sample depth buffer using UV and save it
|
||||||
float currentDepth = subpassLoad (depthBuffer).r;
|
float currentDepth = subpassLoad (depthBuffer).r + MatProp.data[In2.materialIndex].offset;
|
||||||
|
|
||||||
// Use depth buffer to check against current fragment's depth. If fragment is behind depth buffer, render fragment.
|
// Use depth buffer to check against current fragment's depth. If fragment is behind depth buffer, render fragment.
|
||||||
if (currentDepth > gl_FragCoord.z)
|
if (currentDepth > gl_FragCoord.z)
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue