@ -1,3 +1,3 @@ | |||
version https://git-lfs.github.com/spec/v1 | |||
oid sha256:73961d0d39f666b39e7bd525f63de362a0140e1fec7e05471bbb5d3d0185f601 | |||
size 489384 | |||
oid sha256:6ed1b07a234bca13391c2b104ea8edddc7dc5a4b8595f806046864db37af545a | |||
size 481523 |
@ -1,62 +0,0 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
public class PortalColourChange : MonoBehaviour | |||
{ | |||
//get materials/colour from players | |||
//hard code for now | |||
Color deactiveGrey = new Color32(120, 120, 120, 255); | |||
Color red = new Color32(255, 0, 0, 255); | |||
Color purple = new Color32(183, 96, 255, 255); | |||
Color yellow = new Color32(255, 241, 36, 255); | |||
//load portal | |||
public ParticleSystem Edge; | |||
public ParticleSystem InSpark; | |||
public ParticleSystem RandomSparks; | |||
public ParticleSystem Ring; | |||
public ParticleSystem Smoke; | |||
private void Awake() | |||
{ | |||
var mainEdge = Edge.main; | |||
var mainInSpark = InSpark.main; | |||
var mainRandomSparks = RandomSparks.main; | |||
var mainRing = Ring.main; | |||
var mainSmoke = Smoke.main; | |||
mainEdge.startColor = deactiveGrey; | |||
mainInSpark.startColor = deactiveGrey; | |||
InSpark.Stop(); | |||
mainRandomSparks.startColor = deactiveGrey; | |||
RandomSparks.Stop(); | |||
mainRing.startColor = deactiveGrey; | |||
mainSmoke.startColor = deactiveGrey; | |||
Smoke.Stop(); | |||
} | |||
private void start() | |||
{ | |||
//when someone collects enough items | |||
//InSpark.Play(); | |||
//RandomSparks.Play(); | |||
//Smoke.Play(); | |||
//while not everyone has exited | |||
//mainEdge.startColor = red; | |||
//mainInSpark.startColor = red; | |||
//mainRandomSparks.startColor = red; | |||
//mainRing.startColor = red; | |||
//mainSmoke.startColor = red; | |||
//yield return new WaitForSeconds(5); | |||
//loop until all players have hit the portal | |||
} | |||
} | |||
@ -0,0 +1,84 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
using UnityEngine.Networking; | |||
using Networking.Server; | |||
using Networking; | |||
public class PortalSetup : MonoBehaviour | |||
{ | |||
public ConnectionHandler clientDataList; | |||
public List<ClientData> ConnectedClients; | |||
public Color[] playerColours; | |||
public List<int> validIndex; | |||
public float collectAmount; | |||
public float waitTime; | |||
int currentIndex = 0; | |||
Color deactiveGrey = new Color32 (120, 120, 120, 255); | |||
Color deactiveGreyA = new Color32 (120, 120, 120, 0); | |||
bool collectedFive = false; | |||
//load portal | |||
public ParticleSystem Edge; | |||
public ParticleSystem InSpark; | |||
public ParticleSystem RandomSparks; | |||
public ParticleSystem Ring; | |||
public ParticleSystem Smoke; | |||
ParticleSystem.MainModule mainEdge; | |||
ParticleSystem.MainModule mainInSpark; | |||
ParticleSystem.MainModule mainRandomSparks; | |||
ParticleSystem.MainModule mainRing; | |||
ParticleSystem.MainModule mainSmoke; | |||
IEnumerator ColorChange () | |||
{ | |||
while(true){ | |||
mainEdge.startColor = playerColours[validIndex[currentIndex]]; | |||
mainInSpark.startColor = playerColours[validIndex[currentIndex]]; | |||
mainRandomSparks.startColor = playerColours[validIndex[currentIndex]]; | |||
mainRing.startColor = playerColours[validIndex[currentIndex]]; | |||
mainSmoke.startColor = playerColours[validIndex[currentIndex]]; | |||
currentIndex++; | |||
if(currentIndex >= validIndex.Count){ | |||
currentIndex = 0; | |||
} | |||
yield return new WaitForSeconds (5.0f); | |||
} | |||
} | |||
void Update() | |||
{ | |||
if (!collectedFive && (ConnectedClients[0].collected >= collectAmount || ConnectedClients[1].collected >= collectAmount || ConnectedClients[2].collected >= collectAmount || ConnectedClients[3].collected >= collectAmount)){ | |||
collectedFive = true; | |||
StartCoroutine (ColorChange ()); | |||
} | |||
} | |||
private void Awake () | |||
{ | |||
//get list of players | |||
ConnectedClients = clientDataList.ConnectedClients; | |||
playerColours = new Color[ConnectedClients.Count]; | |||
validIndex = new List<int>(); | |||
for (int i = 0; i < ConnectedClients.Count; i++){ | |||
playerColours[i] = ConnectedClients[i].Color; | |||
} | |||
//link portal particle sections | |||
mainEdge = Edge.main; | |||
mainInSpark = InSpark.main; | |||
mainRandomSparks = RandomSparks.main; | |||
mainRing = Ring.main; | |||
mainSmoke = Smoke.main; | |||
//set start mode for portal | |||
mainEdge.startColor = deactiveGrey; | |||
mainInSpark.startColor = deactiveGreyA; | |||
mainRandomSparks.startColor = deactiveGreyA; | |||
mainRing.startColor = deactiveGrey; | |||
mainSmoke.startColor = deactiveGreyA; | |||
} | |||
} |
@ -1,5 +1,5 @@ | |||
fileFormatVersion: 2 | |||
guid: 6603f714d8c458446a8adc74a3df6f66 | |||
guid: 1cf41f7a1d430764d99b705f3d39ebee | |||
MonoImporter: | |||
externalObjects: {} | |||
serializedVersion: 2 |
@ -0,0 +1,51 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
using UnityEngine.Networking; | |||
using Networking.Server; | |||
using Networking; | |||
public class portalTesting : MonoBehaviour | |||
{ | |||
public ConnectionHandler clientDataList; | |||
public List<ClientData> ConnectedClients; | |||
public PortalSetup ps; | |||
void Start(){ | |||
ConnectedClients = clientDataList.ConnectedClients; | |||
} | |||
// Update is called once per frame | |||
void Update() | |||
{ | |||
if(Input.GetKeyDown(KeyCode.A)){ | |||
ConnectedClients[0].collected++; | |||
if(ConnectedClients[0].collected >= 5){ | |||
ps.validIndex.Add(0); | |||
} | |||
} | |||
if(Input.GetKeyDown(KeyCode.B)){ | |||
ConnectedClients[1].collected++; | |||
if(ConnectedClients[1].collected >= 5){ | |||
ps.validIndex.Add(1); | |||
} | |||
} | |||
if(Input.GetKeyDown(KeyCode.C)){ | |||
ConnectedClients[2].collected++; | |||
if(ConnectedClients[2].collected >= 5){ | |||
ps.validIndex.Add(2); | |||
} | |||
} | |||
if(Input.GetKeyDown(KeyCode.D)){ | |||
ConnectedClients[3].collected++; | |||
if(ConnectedClients[3].collected >= 5){ | |||
ps.validIndex.Add(3); | |||
} | |||
} | |||
} | |||
} |
@ -0,0 +1,11 @@ | |||
fileFormatVersion: 2 | |||
guid: 51774b69ca73ce6469c6a1d83fbcc234 | |||
MonoImporter: | |||
externalObjects: {} | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -1,3 +1,3 @@ | |||
version https://git-lfs.github.com/spec/v1 | |||
oid sha256:78680bdd3f2ad76a3866522fb66f47fb5a7875082dca4c7d08e7899aaeecf975 | |||
size 373213 | |||
oid sha256:6f05384c66915dda38a4164f6d2c6ab5a56d1a461c20a3f9b40664ddd9b3aa8b | |||
size 365146 |
@ -1,3 +1,3 @@ | |||
version https://git-lfs.github.com/spec/v1 | |||
oid sha256:c0eb2b452d7efe00ddd7ed9dc6f61a8d892f23ee7f48ea17c8b9d42b3fdd2fa6 | |||
size 489384 | |||
oid sha256:59533852ae2e4a114610902491f460274a863fbe4ae71c6e02202466c53778d1 | |||
size 487847 |
@ -1,3 +1,3 @@ | |||
version https://git-lfs.github.com/spec/v1 | |||
oid sha256:235fe159c62318c0149bf894ae92b45409b08b5a18c33a9e14d39503e3a4ccf3 | |||
size 4765041 | |||
oid sha256:ee1896d036c2586bff6a3d4c1fa527089be2b62606a7ffdedd7398b764b48748 | |||
size 6040461 |
@ -1,44 +0,0 @@ | |||
{ | |||
"dependencies": { | |||
"com.unity.ads": "2.0.8", | |||
"com.unity.analytics": "3.2.2", | |||
"com.unity.collab-proxy": "1.2.15", | |||
"com.unity.package-manager-ui": "2.0.3", | |||
"com.unity.purchasing": "2.0.3", | |||
"com.unity.textmeshpro": "1.3.0", | |||
"com.unity.modules.ai": "1.0.0", | |||
"com.unity.progrids": "3.0.0", | |||
"com.unity.modules.animation": "1.0.0", | |||
"com.unity.modules.assetbundle": "1.0.0", | |||
"com.unity.modules.audio": "1.0.0", | |||
"com.unity.modules.cloth": "1.0.0", | |||
"com.unity.modules.director": "1.0.0", | |||
"com.unity.modules.imageconversion": "1.0.0", | |||
"com.unity.modules.imgui": "1.0.0", | |||
"com.unity.modules.jsonserialize": "1.0.0", | |||
"com.unity.modules.particlesystem": "1.0.0", | |||
"com.unity.modules.physics": "1.0.0", | |||
"com.unity.modules.physics2d": "1.0.0", | |||
"com.unity.modules.screencapture": "1.0.0", | |||
"com.unity.modules.terrain": "1.0.0", | |||
"com.unity.modules.terrainphysics": "1.0.0", | |||
"com.unity.modules.tilemap": "1.0.0", | |||
"com.unity.modules.ui": "1.0.0", | |||
"com.unity.modules.uielements": "1.0.0", | |||
"com.unity.modules.umbra": "1.0.0", | |||
"com.unity.modules.unityanalytics": "1.0.0", | |||
"com.unity.modules.unitywebrequest": "1.0.0", | |||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0", | |||
"com.unity.modules.unitywebrequestaudio": "1.0.0", | |||
"com.unity.modules.unitywebrequesttexture": "1.0.0", | |||
"com.unity.modules.unitywebrequestwww": "1.0.0", | |||
"com.unity.modules.vehicles": "1.0.0", | |||
"com.unity.modules.video": "1.0.0", | |||
"com.unity.modules.vr": "1.0.0", | |||
"com.unity.modules.wind": "1.0.0", | |||
"com.unity.modules.xr": "1.0.0" | |||
}, | |||
"registry":"http://staging-packages.unity.com" | |||
} |