Skip to content

Commit

Permalink
#5 load correct scenes for networking
Browse files Browse the repository at this point in the history
  • Loading branch information
hani-sayegh committed Mar 23, 2017
1 parent e9ce8bb commit 7d1c9c2
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 53 deletions.
49 changes: 34 additions & 15 deletions Assets/MenuSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ public class MenuSelection : MonoBehaviour
// Use this for initialization
void Start()
{
#if NETWORKING
if (SceneManager.GetActiveScene().name == "HostMenu")
{
NetworkManager.singleton.StartHost();
//GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>().StartLoadingScene("Level1Net");
}
else
{
//need to make this look nicer
//192.168.0.32
NetworkManager.singleton.networkAddress = "localhost";//HARD CODE IP ADDRESS HERE
NetworkManager.singleton.StartClient();
}
#endif
selection = 0;
tvScripts = GameObject.Find("Console Screen").GetComponents<tvScreen>();
}
Expand Down Expand Up @@ -98,21 +112,26 @@ void Update()
{
//HANI
case 0: //START
#if NETWORKING
if (SceneManager.GetActiveScene().name == "HostMenu")
{
NetworkManager.singleton.StartHost();
//GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>().StartLoadingScene("Level1Net");
}
else
{
//need to make this look nicer
NetworkManager.singleton.networkAddress = "localhost";//hard code ip address here
NetworkManager.singleton.StartClient();
}
#else
GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>().StartLoadingScene("Playtest 1 With Assets");
#endif
GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>().StartLoadingScene("Level1Net");
//#if NETWORKING
// if (SceneManager.GetActiveScene().name == "HostMenu")
// {
// NetworkManager.singleton.StartHost();
//GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>().StartLoadingScene("Level1Net");
//LoadingScene.m_SceneToLoad = "Level1Net";
//GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>().m_SceneToLoad = "Level1Net";
//var test = GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>();
//("Level1Net");
// }
// else
// {
// //need to make this look nicer
// NetworkManager.singleton.networkAddress = "localhost";//HARD CODE IP ADDRESS HERE
// NetworkManager.singleton.StartClient();
// }
//#else
//GameObject.FindGameObjectWithTag("Scene Loader").GetComponent<SceneSwitch>().StartLoadingScene("Playtest 1 With Assets");
//#endif

break;
case 1: //OPTIONS
Expand Down
2 changes: 0 additions & 2 deletions Assets/Third Party/VHS/Scripts/VHSPostProcessEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class VHSPostProcessEffect : PostEffectsBase

float yScanline, xScanline;

#if !NETWORKING
protected override void Start()
{
m = new Material(shader);
Expand All @@ -38,5 +37,4 @@ void OnRenderImage(RenderTexture source, RenderTexture destination)
m.SetFloat("_xScanline", xScanline * intensity);
Graphics.Blit(source, destination, m);
}
#endif
}
2 changes: 1 addition & 1 deletion Assets/hanisstuff/ClientMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ Prefab:
- target: {fileID: 114642943500370472, guid: 943bfba2f2daf2849a5648a5bdbd03a4,
type: 2}
propertyPath: m_Enabled
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114340792954318156, guid: 943bfba2f2daf2849a5648a5bdbd03a4,
type: 2}
Expand Down
11 changes: 3 additions & 8 deletions Assets/hanisstuff/HostMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -4802,19 +4802,14 @@ Prefab:
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114642943500370472, guid: 943bfba2f2daf2849a5648a5bdbd03a4,
type: 2}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114340792954318156, guid: 943bfba2f2daf2849a5648a5bdbd03a4,
type: 2}
propertyPath: m_OnlineScene
value: Level1Net
propertyPath: m_OfflineScene
value:
objectReference: {fileID: 0}
- target: {fileID: 114340792954318156, guid: 943bfba2f2daf2849a5648a5bdbd03a4,
type: 2}
propertyPath: m_OfflineScene
propertyPath: m_OnlineScene
value: HostMenu
objectReference: {fileID: 0}
m_RemovedComponents: []
Expand Down
56 changes: 30 additions & 26 deletions Assets/hanisstuff/Level1Net.unity
Original file line number Diff line number Diff line change
Expand Up @@ -9791,28 +9791,6 @@ Prefab:
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 797b810c2cc17824092b6fa4cf1d7050, type: 2}
m_IsPrefabParent: 0
--- !u!84 &1254102538
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_Width: 681
m_Height: 688
m_AntiAliasing: 2
m_DepthFormat: 2
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_TextureSettings:
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapMode: 1
--- !u!84 &1259755245
RenderTexture:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -10241,24 +10219,28 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 4603908641567310, guid: 175a1e73cd82624469942dbff261beef, type: 2}
propertyPath: m_LocalRotation.x
value: 0.07046056
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4603908641567310, guid: 175a1e73cd82624469942dbff261beef, type: 2}
propertyPath: m_LocalRotation.y
value: 0.68429655
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4603908641567310, guid: 175a1e73cd82624469942dbff261beef, type: 2}
propertyPath: m_LocalRotation.z
value: 0.066714525
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4603908641567310, guid: 175a1e73cd82624469942dbff261beef, type: 2}
propertyPath: m_LocalRotation.w
value: -0.72271895
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4603908641567310, guid: 175a1e73cd82624469942dbff261beef, type: 2}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4603908641567310, guid: 175a1e73cd82624469942dbff261beef, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 175a1e73cd82624469942dbff261beef, type: 2}
m_IsPrefabParent: 0
Expand Down Expand Up @@ -17205,6 +17187,28 @@ Prefab:
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 797b810c2cc17824092b6fa4cf1d7050, type: 2}
m_IsPrefabParent: 0
--- !u!84 &2123115899
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_Width: 1904
m_Height: 1013
m_AntiAliasing: 2
m_DepthFormat: 2
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_TextureSettings:
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapMode: 1
--- !u!1 &2124343006
GameObject:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/hanisstuff/prefab/NetworkManager.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ MonoBehaviour:
m_AutoCreatePlayer: 1
m_PlayerSpawnMethod: 1
m_OfflineScene: HostMenu
m_OnlineScene: Menuswitch
m_OnlineScene: Level1Net
m_SpawnPrefabs:
- {fileID: 1166831496739124, guid: 91b3a489d25cb294689da4a02db3e063, type: 2}
m_CustomConfig: 1
Expand Down

0 comments on commit 7d1c9c2

Please sign in to comment.