Compare commits
2 Commits
a076f5000f
...
801dcd3d66
Author | SHA1 | Date |
---|---|---|
BOT Alex | 801dcd3d66 | |
BOT Alex | 9a2538c772 |
|
@ -52,6 +52,8 @@ SpriteRenderer:
|
|||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
|
@ -89,7 +91,7 @@ SpriteRenderer:
|
|||
m_SpriteSortPoint: 0
|
||||
--- !u!95 &8069942137008974672
|
||||
Animator:
|
||||
serializedVersion: 5
|
||||
serializedVersion: 7
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
|
@ -103,6 +105,7 @@ Animator:
|
|||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_AnimatePhysics: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
|
@ -116,6 +119,7 @@ CircleCollider2D:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1936012740462134995}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
|
@ -139,9 +143,9 @@ CircleCollider2D:
|
|||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
serializedVersion: 2
|
||||
m_Radius: 0.5
|
||||
--- !u!114 &5062989152879916107
|
||||
MonoBehaviour:
|
||||
|
@ -318,6 +322,8 @@ 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
|
||||
|
@ -355,7 +361,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 3dbdb849a2f5df14d9e109a7776c5ac0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
animationHandler: {fileID: 0}
|
||||
moveSpeed: 70
|
||||
whipSmashSpeed: 2
|
||||
whipSmashDamageMult: 2
|
||||
|
@ -468,7 +473,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
GlobalObjectIdHash: 4009941625
|
||||
GlobalObjectIdHash: 2899378164
|
||||
InScenePlacedSourceGlobalObjectIdHash: 0
|
||||
AlwaysReplicateAsRoot: 0
|
||||
SynchronizeTransform: 1
|
||||
ActiveSceneSynchronization: 0
|
||||
|
@ -527,6 +533,8 @@ TrailRenderer:
|
|||
m_ReflectionProbeUsage: 0
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
|
@ -631,6 +639,49 @@ 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
|
@ -8,16 +8,9 @@ using UnityEngine.SceneManagement;
|
|||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
public static GameManager Instance { get; private set; }
|
||||
public List<GameObject> Players = new List<GameObject>();
|
||||
|
||||
public Action OnPlayerDied;
|
||||
|
||||
private string penisSuriveTime = "";
|
||||
|
||||
public int Revives { get; private set; }
|
||||
|
||||
public GameObject ReviveParticleSystem;
|
||||
|
||||
public TMPro.TextMeshProUGUI ReviveText;
|
||||
public static Action<GameObject[]> OnPlayersReady;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
|
@ -27,71 +20,60 @@ public class GameManager : MonoBehaviour
|
|||
}
|
||||
|
||||
Instance = this;
|
||||
Revives = 1;
|
||||
ReviveText.text = Revives + "x";
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
StartCoroutine(WaitForPlayers());
|
||||
}
|
||||
|
||||
public void playerDied(GameObject who)
|
||||
private IEnumerator WaitForPlayers()
|
||||
{
|
||||
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);
|
||||
}
|
||||
yield return new WaitUntil(()=>Players.Count == 2);
|
||||
OnPlayersReady?.Invoke(Players.ToArray());
|
||||
}
|
||||
|
||||
public void AddRevive()
|
||||
{
|
||||
Revives++;
|
||||
ReviveText.text = Revives + "x";
|
||||
}
|
||||
//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 setTime(string t)
|
||||
{
|
||||
penisSuriveTime = t;
|
||||
}
|
||||
// Debug.Log(d);
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
// 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);
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1f57343bf29d26c4995925ddca512e41
|
|
@ -35,12 +35,13 @@ public class NetworkedGameSetup : NetworkBehaviour
|
|||
bool isServer = SteamManager.IsServer || LocalManager.IsServer;
|
||||
|
||||
GameObject[] players;
|
||||
if (isServer)
|
||||
players = SpawnPlayers(playerIds);
|
||||
else
|
||||
players = GetPlayers(playerIds);
|
||||
players = SpawnPlayers(playerIds);
|
||||
//if (isServer)
|
||||
// players = SpawnPlayers(playerIds);
|
||||
//else
|
||||
// players = GetPlayers(playerIds);
|
||||
|
||||
StartCoroutine(LateSetupProcedue(players));
|
||||
//StartCoroutine(LateSetupProcedue(players));
|
||||
}
|
||||
|
||||
private IEnumerator LateSetupProcedue(GameObject[] players)
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b84328426b0c0d34680fca7de411409b
|
|
@ -12,7 +12,8 @@
|
|||
"GUID:42d1898a72cfe6848ae89835fb20acd2",
|
||||
"GUID:ff1c299121c93f34ca827a253fc30a61",
|
||||
"GUID:1eb4e3e6c04cdc848bab71651b1e2ecd",
|
||||
"GUID:62165c64e8180c441b8cfaa6b82208af"
|
||||
"GUID:62165c64e8180c441b8cfaa6b82208af",
|
||||
"GUID:c0e1b40f519e6e84b8f4af9930403ecb"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
|
|
@ -22,6 +22,5 @@ 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -360,7 +360,6 @@ public class Upgrader : MonoBehaviour
|
|||
public void ReviveUpgrade()
|
||||
{
|
||||
description.text = upgrades.reviveUpgrade.name;
|
||||
GameManager.Instance.AddRevive();
|
||||
}
|
||||
|
||||
IEnumerator updateBloodMeter()
|
||||
|
|
|
@ -19,3 +19,4 @@ EditorBuildSettings:
|
|||
guid: 485a4a01988ea88d08f76e749dcbd6c0
|
||||
m_configObjects:
|
||||
com.unity.input.settings: {fileID: 11400000, guid: de04e34f85a966e4da851d9b3d804fa1, type: 2}
|
||||
m_UseUCBPForAssetBundles: 0
|
||||
|
|
Loading…
Reference in New Issue