JoshuaReason 5 years ago
parent
commit
6cf701a02e
5 changed files with 517 additions and 22 deletions
  1. +405
    -11
      Assets/Scenes/MainScene.unity
  2. +5
    -0
      Assets/Scipts/GameMode.cs
  3. +78
    -0
      Assets/Scipts/Map.cs
  4. +11
    -0
      Assets/Scipts/Map.cs.meta
  5. +18
    -11
      Assets/Scipts/Timer.cs

+ 405
- 11
Assets/Scenes/MainScene.unity View File

@ -113,6 +113,91 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &80434429
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 80434433}
- component: {fileID: 80434432}
- component: {fileID: 80434431}
- component: {fileID: 80434430}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &80434430
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 80434429}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &80434431
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 80434429}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &80434432
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 80434429}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &80434433
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 80434429}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &236454819
GameObject:
m_ObjectHideFlags: 0
@ -299,7 +384,7 @@ MonoBehaviour:
Pivot: {fileID: 264010775}
Sun: {fileID: 2018855991}
Dawn: {r: 1, g: 0.490047, b: 0, a: 1}
Noon: {r: 0.9801799, g: 1, b: 0, a: 1}
Noon: {r: 1, g: 0.97088087, b: 0, a: 1}
--- !u!4 &340012150
Transform:
m_ObjectHideFlags: 0
@ -311,7 +396,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &426060142
GameObject:
@ -373,7 +458,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &595369010
GameObject:
@ -567,13 +652,90 @@ Transform:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 666069794}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 452, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_Father: {fileID: 1492969500}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &700181634
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 700181637}
- component: {fileID: 700181636}
- component: {fileID: 700181635}
m_Layer: 0
m_Name: BotCam
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &700181635
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 700181634}
m_Enabled: 1
--- !u!20 &700181636
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 700181634}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &700181637
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 700181634}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 707.78467, y: 154.55489, z: -5.875}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1057999593
GameObject:
m_ObjectHideFlags: 0
@ -769,6 +931,83 @@ CanvasRenderer:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1154906379}
m_CullTransparentMesh: 0
--- !u!1 &1195683498
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1195683501}
- component: {fileID: 1195683500}
- component: {fileID: 1195683499}
m_Layer: 0
m_Name: RightCam
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1195683499
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1195683498}
m_Enabled: 1
--- !u!20 &1195683500
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1195683498}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1195683501
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1195683498}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 707.78467, y: 154.55489, z: -5.875}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1266934408
GameObject:
m_ObjectHideFlags: 0
@ -801,7 +1040,7 @@ RectTransform:
- {fileID: 2018855991}
- {fileID: 264010775}
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -900,12 +1139,90 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1492969498}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 707.78467, y: 254.55489, z: -5.875}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 666069797}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1779215476
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1779215479}
- component: {fileID: 1779215478}
- component: {fileID: 1779215477}
m_Layer: 0
m_Name: LeftCam
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1779215477
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1779215476}
m_Enabled: 1
--- !u!20 &1779215478
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1779215476}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1779215479
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1779215476}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 707.78467, y: 154.55489, z: -5.875}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1908726377
GameObject:
m_ObjectHideFlags: 0
@ -1028,6 +1345,83 @@ CanvasRenderer:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1908726377}
m_CullTransparentMesh: 0
--- !u!1 &2005481972
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2005481975}
- component: {fileID: 2005481974}
- component: {fileID: 2005481973}
m_Layer: 0
m_Name: TopCam
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &2005481973
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2005481972}
m_Enabled: 1
--- !u!20 &2005481974
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2005481972}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &2005481975
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2005481972}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 707.78467, y: 154.55489, z: -5.875}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &2018855990
GameObject:
m_ObjectHideFlags: 0

+ 5
- 0
Assets/Scipts/GameMode.cs View File

@ -68,4 +68,9 @@ public class GameMode : MonoBehaviour {
}
}
public List<GameObject> GetPlayers()
{
return Players;
}
}

+ 78
- 0
Assets/Scipts/Map.cs View File

@ -0,0 +1,78 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Map : MonoBehaviour {
public GameMode mode; //Reference to the scenes gamemode script
GameObject LocalPlayer;
//Minimum and maximum values for the map
public float minX;
public float maxX;
public float minZ;
public float maxZ;
public GameObject TopCam;
public GameObject BotCam;
public GameObject LeftCam;
public GameObject RightCam;
//How wide halfd the camera is for the resizing
public float camWidth = 8.0f;
public float camHeight = 5.0f;
void Update()
{
Teleport();
HandleCameraMovement(TopCam, true);
HandleCameraMovement(BotCam, true);
HandleCameraMovement(LeftCam, false);
HandleCameraMovement(RightCam, false);
}
void Teleport()
{
Transform PT = localPlayer.Transform;
if (PT.position.x > maxX)
{
PT.position = new Vector3(minX, PT.position.y, PT.position.z);
}
else if (PT.position.x < minX)
{
PT.position = new Vector3(maxX, PT.position.y, PT.position.z);
}
if (PT.position.z > maxZ)
{
PT.position = new Vector3(PT.position.x, PT.position.y, minZ);
}
else if (PT.position.x < minX)
{
PT.position = new Vector3(PT.position.x, PT.position.y, maxZ);
}
}
/// <summary>
///
/// </summary>
/// <param name="Cam"> The camera to move</param>
/// <param name="Xmove">Do we move in the X axis or the Z?</param>
void HandleCameraMovement(GameObject Cam, bool Xmove)
{
if (Xmove == true)
{
Cam.transform.position = new Vector3(LocalPlayer.transform.position.x, Cam.transform.position.y, Cam.transform.position.z);
}
else
{
Cam.transform.position = new Vector3(Cam.transform.position.x, Cam.transform.position.y, LocalPlayer.transform.position.z);
}
}
void HandleCamSizing()
{
}
}

+ 11
- 0
Assets/Scipts/Map.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fb1b808875f0dab4f9905cced86ca98a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 18
- 11
Assets/Scipts/Timer.cs View File

@ -15,9 +15,18 @@ public class Timer : MonoBehaviour {
public Color Dawn;
public Color Noon;
float DawnValue;
float NoonValue;
float colorDif;
Image SunImage;
void Start()
{
Sun.gameObject.GetComponent<Image>().color = Dawn;
SunImage = Sun.gameObject.GetComponent<Image>();
SunImage.color = Dawn;
DawnValue = Dawn.b;
NoonValue = Noon.b;
colorDif = Mathf.Abs(NoonValue - DawnValue);
}
void Update () {
@ -27,20 +36,18 @@ public class Timer : MonoBehaviour {
//Game Lose code here
}
/*
//Move the sun
float reqRot = (curTime / MaxTimer) * 180;
if (reqRot > 180)
Color newColor;
if (curTime > MaxTimer / 2)
{
reqRot = 180;
newColor = new Color(SunImage.color.r, SunImage.color.g - colorDif * ((90 / MaxTimer) * Time.deltaTime), SunImage.color.b );
}
if (reqRot > curRot)
else
{
float rotDistance = reqRot - curRot;
// Sun.RotateAround(Pivot.transform.position, Sun.transform.forward, rotDistance);
curRot = reqRot;
newColor = new Color(SunImage.color.r, SunImage.color.g + colorDif * ((90 / MaxTimer) * Time.deltaTime), SunImage.color.b);
}
*/
SunImage.color = newColor;
Sun.RotateAround(Pivot.transform.position, -1 * Sun.transform.forward, (180 / MaxTimer) * Time.deltaTime);
}

Loading…
Cancel
Save