Compare commits

..

No commits in common. "801dcd3d669a8ef02e61c5106f8ab937381e45cf" and "a076f5000f7eb15d2fd0d2d5a1a45c80cbfe124c" have entirely different histories.

12 changed files with 77 additions and 4897 deletions

View File

@ -52,8 +52,6 @@ SpriteRenderer:
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
@ -91,7 +89,7 @@ SpriteRenderer:
m_SpriteSortPoint: 0
--- !u!95 &8069942137008974672
Animator:
serializedVersion: 7
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -105,7 +103,6 @@ Animator:
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_AnimatePhysics: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
@ -119,7 +116,6 @@ CircleCollider2D:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936012740462134995}
m_Enabled: 1
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
@ -143,9 +139,9 @@ CircleCollider2D:
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.5
--- !u!114 &5062989152879916107
MonoBehaviour:
@ -322,8 +318,6 @@ GameObject:
- component: {fileID: 5998872828059799024}
- component: {fileID: 8582716114041666362}
- component: {fileID: 4721273529951287494}
- component: {fileID: 93986863963319370}
- component: {fileID: -5630779774840087441}
m_Layer: 7
m_Name: NetworkedPlayer
m_TagString: Player
@ -361,6 +355,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3dbdb849a2f5df14d9e109a7776c5ac0, type: 3}
m_Name:
m_EditorClassIdentifier:
animationHandler: {fileID: 0}
moveSpeed: 70
whipSmashSpeed: 2
whipSmashDamageMult: 2
@ -473,8 +468,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier:
GlobalObjectIdHash: 2899378164
InScenePlacedSourceGlobalObjectIdHash: 0
GlobalObjectIdHash: 4009941625
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
@ -533,8 +527,6 @@ TrailRenderer:
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
@ -639,49 +631,6 @@ TrailRenderer:
m_Autodestruct: 0
m_Emitting: 1
m_ApplyActiveColorSpace: 1
--- !u!114 &93986863963319370
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3120938410244321186}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1f57343bf29d26c4995925ddca512e41, type: 3}
m_Name:
m_EditorClassIdentifier:
UseUnreliableDeltas: 0
SyncPositionX: 1
SyncPositionY: 1
SyncPositionZ: 0
SyncRotAngleX: 0
SyncRotAngleY: 0
SyncRotAngleZ: 0
SyncScaleX: 0
SyncScaleY: 0
SyncScaleZ: 0
PositionThreshold: 0.001
RotAngleThreshold: 0.01
ScaleThreshold: 0.01
UseQuaternionSynchronization: 0
UseQuaternionCompression: 0
UseHalfFloatPrecision: 0
InLocalSpace: 0
Interpolate: 1
SlerpPosition: 0
--- !u!114 &-5630779774840087441
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3120938410244321186}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b84328426b0c0d34680fca7de411409b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &6225877037457186740
PrefabInstance:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -8,9 +8,16 @@ using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
public static GameManager Instance { get; private set; }
public List<GameObject> Players = new List<GameObject>();
public static Action<GameObject[]> OnPlayersReady;
public Action OnPlayerDied;
private string penisSuriveTime = "";
public int Revives { get; private set; }
public GameObject ReviveParticleSystem;
public TMPro.TextMeshProUGUI ReviveText;
void Awake()
{
@ -20,60 +27,71 @@ public class GameManager : MonoBehaviour
}
Instance = this;
Revives = 1;
ReviveText.text = Revives + "x";
}
void Start()
{
StartCoroutine(WaitForPlayers());
}
private IEnumerator WaitForPlayers()
public void playerDied(GameObject who)
{
yield return new WaitUntil(()=>Players.Count == 2);
OnPlayersReady?.Invoke(Players.ToArray());
Debug.Log($"{who.name} died");
if (Revives == 0)
{
AudioManager.Instance.StopAllAudio();
AudioManager.PlaySound("Game_Over_Jingle", Vector3.zero);
SceneManager.LoadScene(3);
}
else
{
Revives--;
ReviveText.text = Revives + "x";
Collider2D[] d = Physics2D.OverlapCircleAll(who.transform.position, 3f);
Debug.Log(d);
foreach (Collider2D c in d)
{
if (c.gameObject.CompareTag("Enemy"))
{
c.gameObject.GetComponent<HealthComponent>().TakeDamage(69420);
}
}
var g = who.GetComponent<HealthComponent>();
// heal
g.setMaxHealth(g.getMaxHealth(), true);
g.resetKillFlag();
// REVIVE SOUND HERE
AudioManager.PlaySound("Revive_SFX", who.transform.position);
RumbleManager.StartRumble(0, 0.3f, 0.1f, 3f);
RumbleManager.StartRumble(1, 0.3f, 0.1f, 3f);
GameObject go = Instantiate(ReviveParticleSystem, who.transform.position, Quaternion.identity);
ParticleSystem ps = go.GetComponent<ParticleSystem>();
ps.Play();
go.AddComponent<DestroyAfter>().Init(5f);
}
}
//public void playerDied(GameObject who)
//{
// Debug.Log($"{who.name} died");
// if (Revives == 0)
// {
// AudioManager.Instance.StopAllAudio();
// AudioManager.PlaySound("Game_Over_Jingle", Vector3.zero);
// SceneManager.LoadScene(3);
// }
// else
// {
// Revives--;
// ReviveText.text = Revives + "x";
// Collider2D[] d = Physics2D.OverlapCircleAll(who.transform.position, 3f);
public void AddRevive()
{
Revives++;
ReviveText.text = Revives + "x";
}
// Debug.Log(d);
public void setTime(string t)
{
penisSuriveTime = t;
}
// foreach (Collider2D c in d)
// {
// if (c.gameObject.CompareTag("Enemy"))
// {
// c.gameObject.GetComponent<HealthComponent>().TakeDamage(69420);
// }
// }
// var g = who.GetComponent<HealthComponent>();
// // heal
// g.setMaxHealth(g.getMaxHealth(), true);
// g.resetKillFlag();
// // REVIVE SOUND HERE
// AudioManager.PlaySound("Revive_SFX", who.transform.position);
// RumbleManager.StartRumble(0, 0.3f, 0.1f, 3f);
// RumbleManager.StartRumble(1, 0.3f, 0.1f, 3f);
// GameObject go = Instantiate(ReviveParticleSystem, who.transform.position, Quaternion.identity);
// ParticleSystem ps = go.GetComponent<ParticleSystem>();
// ps.Play();
// go.AddComponent<DestroyAfter>().Init(5f);
// }
//}
// Update is called once per frame
void Update()
{
}
}

View File

@ -1,21 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using Unity.Netcode.Components;
using UnityEngine;
/// <summary>
/// Used for syncing a transform with client side changes. This includes host. Pure server as owner isn't supported by this. Please use NetworkTransform
/// for transforms that'll always be owned by the server.
/// </summary>
[DisallowMultipleComponent]
public class ClientNetworkTransform : NetworkTransform
{
/// <summary>
/// Used to determine who can write to this transform. Owner client only.
/// This imposes state to the server. This is putting trust on your clients. Make sure no security-sensitive features use this transform.
/// </summary>
protected override bool OnIsServerAuthoritative()
{
return false;
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 1f57343bf29d26c4995925ddca512e41

View File

@ -35,13 +35,12 @@ public class NetworkedGameSetup : NetworkBehaviour
bool isServer = SteamManager.IsServer || LocalManager.IsServer;
GameObject[] players;
players = SpawnPlayers(playerIds);
//if (isServer)
// players = SpawnPlayers(playerIds);
//else
// players = GetPlayers(playerIds);
if (isServer)
players = SpawnPlayers(playerIds);
else
players = GetPlayers(playerIds);
//StartCoroutine(LateSetupProcedue(players));
StartCoroutine(LateSetupProcedue(players));
}
private IEnumerator LateSetupProcedue(GameObject[] players)

View File

@ -1,12 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
public class NetworkedPlayerRegister : NetworkBehaviour
{
public override void OnNetworkSpawn()
{
GameManager.Instance.Players.Add(this.gameObject);
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: b84328426b0c0d34680fca7de411409b

View File

@ -12,8 +12,7 @@
"GUID:42d1898a72cfe6848ae89835fb20acd2",
"GUID:ff1c299121c93f34ca827a253fc30a61",
"GUID:1eb4e3e6c04cdc848bab71651b1e2ecd",
"GUID:62165c64e8180c441b8cfaa6b82208af",
"GUID:c0e1b40f519e6e84b8f4af9930403ecb"
"GUID:62165c64e8180c441b8cfaa6b82208af"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@ -22,5 +22,6 @@ public class SurvivalTimer : MonoBehaviour
int minutes = Mathf.FloorToInt(elapsedTime / 60);
int seconds = Mathf.FloorToInt(elapsedTime % 60);
timerText.text = string.Format("{00:00}:{01:00}", minutes, seconds);
GameManager.Instance.setTime(timerText.text);
}
}

View File

@ -360,6 +360,7 @@ public class Upgrader : MonoBehaviour
public void ReviveUpgrade()
{
description.text = upgrades.reviveUpgrade.name;
GameManager.Instance.AddRevive();
}
IEnumerator updateBloodMeter()

View File

@ -19,4 +19,3 @@ EditorBuildSettings:
guid: 485a4a01988ea88d08f76e749dcbd6c0
m_configObjects:
com.unity.input.settings: {fileID: 11400000, guid: de04e34f85a966e4da851d9b3d804fa1, type: 2}
m_UseUCBPForAssetBundles: 0