Browse Source

Small changes i had here and ones i made to try and fix an error

master
ClairePeta 5 years ago
parent
commit
fb9b352db3
7 changed files with 37 additions and 21 deletions
  1. +6
    -5
      Assets/Prefabs/Traps/ShootingCannon.prefab
  2. +2
    -2
      Assets/Scenes/Levels/RaceTrack Beta.unity
  3. +2
    -2
      Assets/Scenes/Menus/Lobby.unity
  4. +2
    -2
      Assets/Scenes/Menus/MenuBackground.unity
  5. +2
    -2
      Assets/Scripts/Browser/SimpleHttpsServer.cs
  6. +19
    -6
      Assets/Scripts/Character.cs
  7. +4
    -2
      Assets/Scripts/Managers/GameManager.cs

+ 6
- 5
Assets/Prefabs/Traps/ShootingCannon.prefab View File

@ -462,7 +462,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
VisualOffset: {x: 0, y: 0, z: 0}
is_Walkable: 1
is_Walkable: 0
isWater: 0
isPit: 0
isCrystals: 0
@ -476,6 +476,7 @@ MonoBehaviour:
spawnLocation: {fileID: 4411312180479633393}
counter: {fileID: 1907555563}
counter2: {fileID: 1967023221621108560}
countdown: 3
--- !u!65 &7713460145294617833
BoxCollider:
m_ObjectHideFlags: 0
@ -559,6 +560,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 4407065910963968002}
m_Modifications:
- target: {fileID: 1229707520659320, guid: 601c1b79e12ee6f428da0cdfc7412e9e, type: 3}
propertyPath: m_Name
value: Cube_BalkHalf
objectReference: {fileID: 0}
- target: {fileID: 4831352554563246, guid: 601c1b79e12ee6f428da0cdfc7412e9e, type: 3}
propertyPath: m_LocalPosition.x
value: 0
@ -615,10 +620,6 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1229707520659320, guid: 601c1b79e12ee6f428da0cdfc7412e9e, type: 3}
propertyPath: m_Name
value: Cube_BalkHalf
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 601c1b79e12ee6f428da0cdfc7412e9e, type: 3}
--- !u!1 &4408273554855513639 stripped

+ 2
- 2
Assets/Scenes/Levels/RaceTrack Beta.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5d55c679cbf4a61b8fd1bd247cca637c9a4f56d3105ba39284d86dd4e68002b8
size 40997
oid sha256:e4a9d3dc6e2016e26aa37189520722a0c9135abaff35df3fd2f0a0a7d39e7d46
size 43113

+ 2
- 2
Assets/Scenes/Menus/Lobby.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:522af36cedf7538607021871c5d833031446e7f40e07626f5e059e0d323ceb9e
size 46401
oid sha256:5c4afffd8a2251baa7b0ef9701d4ca5e046a6d10dfe8247ccc07245fcf6c5340
size 46417

+ 2
- 2
Assets/Scenes/Menus/MenuBackground.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:938028e3e34d6913220202dea3966b1045ee47ce508d2fdff1f3418cfaf0801c
size 2851355
oid sha256:83f4e9ca94f66f8f8b6bbdcd56c40e38f2c9ab33b83c2c76db852129c62ace9d
size 2851361

+ 2
- 2
Assets/Scripts/Browser/SimpleHttpsServer.cs View File

@ -172,7 +172,7 @@ class SimpleHTTPServer
filename = Path.Combine(_rootDirectory, filename);
UnityEngine.Debug.Log("Client wants:" + filename);
//UnityEngine.Debug.Log("Client wants:" + filename);
if (File.Exists(filename))
{
@ -202,7 +202,7 @@ class SimpleHTTPServer
Stream st = context.Response.OutputStream;
st.Write(bytes, 0, bytes.Length);
UnityEngine.Debug.Log("Sent");
//UnityEngine.Debug.Log("Sent");
}
catch (Exception ex)
{

+ 19
- 6
Assets/Scripts/Character.cs View File

@ -205,23 +205,36 @@ public class Character : MonoBehaviour
{
respawnCharacter(CurrentBlock);
}
public void respawnCharacter(Block respawnPosition)
{
//Having found our target block, we move the character there
if (respawnPosition != null)
{
this.transform.position = new Vector3(respawnPosition.VisualPosition.x, 0.5f, respawnPosition.VisualPosition.z);
this.respawnNeeded = false;
this._currentBlock = respawnPosition;
respawnPosition.CurrentPlayer = this;
this.stuck = false;
if(ClientLink.Lives > 0)
{
this.transform.position = new Vector3(respawnPosition.VisualPosition.x, 0.5f, respawnPosition.VisualPosition.z);
this.respawnNeeded = false;
this._currentBlock = respawnPosition;
respawnPosition.CurrentPlayer = this;
this.stuck = false;
}
else
{
this.transform.position = new Vector3(-50, 0.5f, 0);
this.respawnNeeded = false;
this._currentBlock = respawnPosition;
respawnPosition.CurrentPlayer = this;
this.stuck = false;
}
}
else
{
//Debug.Log("Failed to find anywhere to put " + this.name);
}
}
/// <summary>
/// Upon collision with a floating block, collect its

+ 4
- 2
Assets/Scripts/Managers/GameManager.cs View File

@ -198,10 +198,12 @@ public class GameManager : MonoBehaviour
}
}
playerData = playerData.OrderBy(unit => unit.Value.character.CurrentBlock.transform.position.x).ToDictionary(unit => unit.Key, unit => unit.Value);
//playerData = playerData.OrderBy(unit => unit.Value.character.CurrentBlock.transform.position.x).ToDictionary(unit => unit.Key, unit => unit.Value);
Dictionary<int,PlayerData> filteredPlayers = playerData.Where(p => !p.Value.isDead).ToDictionary(unit => unit.Key, unit => unit.Value);
Dictionary<int,PlayerData> sortedPlayers = filteredPlayers.OrderBy(p => p.Value.character.CurrentBlock.transform.position.x).ToDictionary(unit => unit.Key, unit => unit.Value);
int order = 1;
foreach (PlayerData data in filteredPlayers.Values)
foreach (PlayerData data in sortedPlayers.Values)
{
data.character.runOrder = order;
order++;

Loading…
Cancel
Save