Browse Source

Forgot to push lafter class last night

master
Claire Peta 5 years ago
parent
commit
50ac156d92
13 changed files with 78 additions and 44 deletions
  1. +1
    -1
      Assets/Data/Inventory/BaseInventory.asset
  2. +2
    -2
      Assets/Data/Logic Blocks/Wait.asset
  3. +23
    -21
      Assets/Prefabs/Traps/Conveyor Belt with Cube.prefab
  4. +7
    -7
      Assets/Prefabs/Traps/ShootingCannon + Block.prefab
  5. +2
    -2
      Assets/Scenes/Client Scenes/LoginScreen.unity
  6. +2
    -2
      Assets/Scenes/Levels/RaceTrack Beta.unity
  7. +2
    -2
      Assets/Scenes/Menus/MainMenu Server.unity
  8. +5
    -0
      Assets/Scripts/GameMode/ColorGameMode/ColorGameMode.cs
  9. +11
    -3
      Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs
  10. +2
    -0
      Assets/Scripts/GameMode/GameMode.cs
  11. +7
    -3
      Assets/Scripts/Logic/BlockReader.cs
  12. +5
    -0
      Assets/Scripts/Managers/GameManager.cs
  13. +9
    -1
      Assets/Scripts/UI/LogicElementUI.cs

+ 1
- 1
Assets/Data/Inventory/BaseInventory.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:07fcd4acc0a169da62bb9e580f52c4c1002bb75840e34c8f645646d3101be1c7
oid sha256:826ec5d0a327952a321ea2e04fd0bf0bb28619e1f6b1861a4765eddcec2019d6
size 1186 size 1186

+ 2
- 2
Assets/Data/Logic Blocks/Wait.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:6475a06eeda44fd342624dfe1b8a353fcbb2e3fe56665c4747e00928f3d2f670
size 574
oid sha256:5b1381e41f5ac83abac527a3f5027da86df42fb91ca17392b26d58ab7c219bba
size 580

+ 23
- 21
Assets/Prefabs/Traps/Conveyor Belt with Cube.prefab View File

@ -45,11 +45,13 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6692f0c965cb4fa41b616ba0991653a3, type: 3} m_Script: {fileID: 11500000, guid: 6692f0c965cb4fa41b616ba0991653a3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
clientData: {fileID: 11400000, guid: ded0b21c3ef1e7049a1128c12e9401fe, type: 2}
Names: []
left: 0
forward: 0
triggeranimate: 0
VisualOffset: {x: 0, y: 0, z: 0}
is_Walkable: 1
isWater: 0
isPit: 0
isSpawnable: 0
SpawnDirection: 2
Action: {fileID: 11400000, guid: 0b1bcd75cb7dade4fb598ee3412594c2, type: 2}
--- !u!1 &3424486742927057916 --- !u!1 &3424486742927057916
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -149,14 +151,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 4490968977809283} m_TransformParent: {fileID: 4490968977809283}
m_Modifications: m_Modifications:
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_Name
value: Cube_GroundL
objectReference: {fileID: 0}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3} - target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -201,6 +195,14 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_Name
value: Cube_GroundL
objectReference: {fileID: 0}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3} m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
--- !u!1001 &816154313 --- !u!1001 &816154313
@ -210,14 +212,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 4490968977809283} m_TransformParent: {fileID: 4490968977809283}
m_Modifications: m_Modifications:
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_Name
value: Cube_GroundU
objectReference: {fileID: 0}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3} - target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -262,6 +256,14 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_Name
value: Cube_GroundU
objectReference: {fileID: 0}
- target: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3} m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
--- !u!1001 &1100376119 --- !u!1001 &1100376119

+ 7
- 7
Assets/Prefabs/Traps/ShootingCannon + Block.prefab View File

@ -254,13 +254,13 @@ RectTransform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7559508468311915786} m_GameObject: {fileID: 7559508468311915786}
m_LocalRotation: {x: 0, y: -0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0.134}
m_LocalRotation: {x: -0, y: -0.8055902, z: -0, w: 0.5924732}
m_LocalPosition: {x: 0, y: 0, z: 0.166}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 6179448856766749153} m_Father: {fileID: 6179448856766749153}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: -107.33501, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.262, y: 1.321} m_AnchoredPosition: {x: 0.262, y: 1.321}
@ -339,7 +339,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_text: 5
m_text: 3
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@ -367,8 +367,8 @@ MonoBehaviour:
m_outlineColor: m_outlineColor:
serializedVersion: 2 serializedVersion: 2
rgba: 4278190080 rgba: 4278190080
m_fontSize: 3
m_fontSizeBase: 3
m_fontSize: 5
m_fontSizeBase: 5
m_fontWeight: 400 m_fontWeight: 400
m_enableAutoSizing: 0 m_enableAutoSizing: 0
m_fontSizeMin: 18 m_fontSizeMin: 18
@ -385,7 +385,7 @@ MonoBehaviour:
m_enableWordWrapping: 1 m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4 m_wordWrappingRatios: 0.4
m_overflowMode: 0 m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_firstOverflowCharacterIndex: 0
m_linkedTextComponent: {fileID: 0} m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0 m_isLinkedTextComponent: 0
m_isTextTruncated: 0 m_isTextTruncated: 0

+ 2
- 2
Assets/Scenes/Client Scenes/LoginScreen.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8db303555f2b5039989ee896f62f0d295bd6448dddc4bbe893977bd85a65d6ea
size 260334
oid sha256:483604a02c8a92d1ac923e970b4e0bc203385ea51d6a516367cc39fc26648333
size 260494

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

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8be6d12cb624b41bbec4263d925f0ff9c62f13f2a60df314dae7bfa3c3132aeb
size 33586
oid sha256:dd7c1363d42eae1aa8086b72ecf7e2ed28f926aaaaa1fd5562c12d6d1fcb5edd
size 33424

+ 2
- 2
Assets/Scenes/Menus/MainMenu Server.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:159c761b5e6cd07723112cccb7f6cd3c7160f84327b1ca89967ad80b68a60404
size 142635
oid sha256:0b221d228eb4be8b6130a49b01f3b31a24e745acb7b73620669ce045b050af24
size 142636

+ 5
- 0
Assets/Scripts/GameMode/ColorGameMode/ColorGameMode.cs View File

@ -206,4 +206,9 @@ public class ColorGameMode : GameMode
OnPlayerMoved(allPlayers[i].character, allPlayers[i].client, allPlayers[i].character.CurrentBlock); OnPlayerMoved(allPlayers[i].character, allPlayers[i].client, allPlayers[i].character.CurrentBlock);
} }
} }
public override PlayerData[] getPlayerOrder(PlayerData[] AllPlayers)
{
throw new System.NotImplementedException();
}
} }

+ 11
- 3
Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs View File

@ -4,6 +4,7 @@ using UnityEngine;
using Networking.Server; using Networking.Server;
using TMPro; using TMPro;
using UnityEngine.UI; using UnityEngine.UI;
using System.Linq;
[CreateAssetMenu(menuName = "Major Project/GameModes/Racetrack", order = 201)] [CreateAssetMenu(menuName = "Major Project/GameModes/Racetrack", order = 201)]
public class RacetrackGameMode : GameMode public class RacetrackGameMode : GameMode
@ -225,13 +226,20 @@ public class RacetrackGameMode : GameMode
mat.SetFloat("_Multiplier", 1); mat.SetFloat("_Multiplier", 1);
} }
protected override void OnGameStart(PlayerData[] allPlayers)
protected override void OnGameStart(PlayerData[] AllPlayers)
{ {
BlocksOwned = new Dictionary<ClientData, List<Block>>(); BlocksOwned = new Dictionary<ClientData, List<Block>>();
RoundCount = 0; RoundCount = 0;
for(int i = 0; i < allPlayers.Length; i++)
AllPlayers = getPlayerOrder(AllPlayers);
for (int i = 0; i < AllPlayers.Length; i++)
{ {
OnPlayerMoved(allPlayers[i].character, allPlayers[i].client, allPlayers[i].character.CurrentBlock);
OnPlayerMoved(AllPlayers[i].character, AllPlayers[i].client, AllPlayers[i].character.CurrentBlock);
} }
} }
public override PlayerData[] getPlayerOrder(PlayerData[] AllPlayers)
{
AllPlayers.OrderByDescending(unit => unit.character.transform.position.x);
return AllPlayers;
}
} }

+ 2
- 0
Assets/Scripts/GameMode/GameMode.cs View File

@ -147,6 +147,8 @@ public abstract class GameMode : ScriptableObject
} }
public abstract PlayerData[] getPlayerOrder(PlayerData[] AllPlayers);
public void RoundStart(PlayerData[] allPlayers) public void RoundStart(PlayerData[] allPlayers)
{ {
OnRoundStart(allPlayers); OnRoundStart(allPlayers);

+ 7
- 3
Assets/Scripts/Logic/BlockReader.cs View File

@ -58,9 +58,12 @@ public class BlockReader
/// <returns>Returns false if other readers should wait for this one to run again</returns> /// <returns>Returns false if other readers should wait for this one to run again</returns>
public IEnumerator Read(Character character, float speedMultiplier) public IEnumerator Read(Character character, float speedMultiplier)
{ {
if(currentBlockIndex >= LogicChain.Count)
{
yield break;
}
LogicBlock currentBlock = LogicChain[currentBlockIndex]; LogicBlock currentBlock = LogicChain[currentBlockIndex];
//If the character has become stuck, they forfeit their remaining moves - we skip directly to their end of their chain //If the character has become stuck, they forfeit their remaining moves - we skip directly to their end of their chain
if (character.stuck == true) if (character.stuck == true)
{ {
@ -77,8 +80,9 @@ public class BlockReader
//(it might not be finished if it is a for loop or something) //(it might not be finished if it is a for loop or something)
if (currentBlock.isFinished()) if (currentBlock.isFinished())
{ {
currentBlock.Reset();
currentBlockIndex++; currentBlockIndex++;
currentBlock.Reset();
} }
//Should other readers wait for this one //Should other readers wait for this one

+ 5
- 0
Assets/Scripts/Managers/GameManager.cs View File

@ -125,11 +125,16 @@ public class GameManager : MonoBehaviour
//Tell the gamemode that we are starting a round //Tell the gamemode that we are starting a round
gameMode.RoundStart(playerDataAsArray); gameMode.RoundStart(playerDataAsArray);
//playerDataAsArray.OrderByDescending(unit => unit.character.transform.position.x);
playerDataAsArray.OrderBy(unit => unit.character.transform.position.x).ToArray();
//Loop until all players have finished moving //Loop until all players have finished moving
while (playerDataAsArray.Any(p => !p.blockReader.Finished)) while (playerDataAsArray.Any(p => !p.blockReader.Finished))
{ {
//Loop through all players //Loop through all players
foreach (PlayerData player in playerDataAsArray) foreach (PlayerData player in playerDataAsArray)

+ 9
- 1
Assets/Scripts/UI/LogicElementUI.cs View File

@ -67,7 +67,15 @@ public class LogicElementUI : Dragable
nameText.outlineWidth = 0.1f; nameText.outlineWidth = 0.1f;
icon.GetComponent<Image>().color = LogicElement.Color; icon.GetComponent<Image>().color = LogicElement.Color;
background.GetComponent<Image>().sprite = LogicElement.icon;
if(logicElement.icon != null)
{
background.GetComponent<Image>().sprite = LogicElement.icon;
}
else
{
background.GetComponent<Image>().enabled = false;
}
} }
} }

Loading…
Cancel
Save