Browse Source

Gravity works

master
MB 5 years ago
parent
commit
548a69fa0e
11 changed files with 106 additions and 3 deletions
  1. +15
    -0
      Assets/FBX/terrain_Prefabs/terr1.prefab
  2. +15
    -0
      Assets/FBX/terrain_Prefabs/terr2.prefab
  3. +15
    -0
      Assets/FBX/terrain_Prefabs/terr3.prefab
  4. +15
    -0
      Assets/FBX/terrain_Prefabs/terr4.prefab
  5. +15
    -0
      Assets/LocalPlayer.cs
  6. +11
    -0
      Assets/LocalPlayer.cs.meta
  7. +13
    -0
      Assets/Prefabs/RealLocalPlayer.prefab
  8. +3
    -2
      Assets/Scenes/LobbyScene.unity
  9. +1
    -1
      Assets/Scipts/Multiplayer/Client/PlayersManager.cs
  10. +1
    -0
      Assets/Scipts/Player.cs
  11. +2
    -0
      Assets/Scipts/UI/LobbyUIController.cs

+ 15
- 0
Assets/FBX/terrain_Prefabs/terr1.prefab View File

@ -1953,6 +1953,7 @@ GameObject:
- component: {fileID: 4572493703287628} - component: {fileID: 4572493703287628}
- component: {fileID: 33302327919172256} - component: {fileID: 33302327919172256}
- component: {fileID: 23524112614537848} - component: {fileID: 23524112614537848}
- component: {fileID: 64087229165304872}
m_Layer: 0 m_Layer: 0
m_Name: terr1 m_Name: terr1
m_TagString: Untagged m_TagString: Untagged
@ -14677,6 +14678,20 @@ MeshCollider:
m_CookingOptions: 14 m_CookingOptions: 14
m_SkinWidth: 0.01 m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: 99d0111f01c394540a69064c1a297091, type: 3} m_Mesh: {fileID: 4300000, guid: 99d0111f01c394540a69064c1a297091, type: 3}
--- !u!64 &64087229165304872
MeshCollider:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1593761762770214}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: a8ba5e24558027e4f9c4fb1163c18e91, type: 3}
--- !u!64 &64088812999245390 --- !u!64 &64088812999245390
MeshCollider: MeshCollider:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

+ 15
- 0
Assets/FBX/terrain_Prefabs/terr2.prefab View File

@ -298,6 +298,7 @@ GameObject:
- component: {fileID: 4282343398127198} - component: {fileID: 4282343398127198}
- component: {fileID: 33526079659851976} - component: {fileID: 33526079659851976}
- component: {fileID: 23872336482510252} - component: {fileID: 23872336482510252}
- component: {fileID: 64668229792911388}
m_Layer: 0 m_Layer: 0
m_Name: terr2 m_Name: terr2
m_TagString: Untagged m_TagString: Untagged
@ -15780,6 +15781,20 @@ MeshCollider:
m_CookingOptions: 14 m_CookingOptions: 14
m_SkinWidth: 0.01 m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: 99d0111f01c394540a69064c1a297091, type: 3} m_Mesh: {fileID: 4300000, guid: 99d0111f01c394540a69064c1a297091, type: 3}
--- !u!64 &64668229792911388
MeshCollider:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1094668700355570}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: 4ca26ac77d0762944818d911d3d4e171, type: 3}
--- !u!64 &64669100819787316 --- !u!64 &64669100819787316
MeshCollider: MeshCollider:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

+ 15
- 0
Assets/FBX/terrain_Prefabs/terr3.prefab View File

@ -2347,6 +2347,7 @@ GameObject:
- component: {fileID: 4406658072793374} - component: {fileID: 4406658072793374}
- component: {fileID: 33913717413823534} - component: {fileID: 33913717413823534}
- component: {fileID: 23446745603181364} - component: {fileID: 23446745603181364}
- component: {fileID: 64533680346656760}
m_Layer: 0 m_Layer: 0
m_Name: terr3 m_Name: terr3
m_TagString: Untagged m_TagString: Untagged
@ -16476,6 +16477,20 @@ MeshCollider:
m_CookingOptions: 14 m_CookingOptions: 14
m_SkinWidth: 0.01 m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: 8079a73d181a97c40968ab54ff444137, type: 3} m_Mesh: {fileID: 4300000, guid: 8079a73d181a97c40968ab54ff444137, type: 3}
--- !u!64 &64533680346656760
MeshCollider:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1575992043817686}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: f67e8a85b29c07f47badc4a0b3fd18f6, type: 3}
--- !u!64 &64535940406289798 --- !u!64 &64535940406289798
MeshCollider: MeshCollider:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

+ 15
- 0
Assets/FBX/terrain_Prefabs/terr4.prefab View File

@ -1081,6 +1081,7 @@ GameObject:
- component: {fileID: 4929833942921672} - component: {fileID: 4929833942921672}
- component: {fileID: 33715934285815486} - component: {fileID: 33715934285815486}
- component: {fileID: 23745084030861904} - component: {fileID: 23745084030861904}
- component: {fileID: 64080985636031386}
m_Layer: 0 m_Layer: 0
m_Name: terr4 m_Name: terr4
m_TagString: Untagged m_TagString: Untagged
@ -10691,6 +10692,20 @@ MeshCollider:
m_CookingOptions: 14 m_CookingOptions: 14
m_SkinWidth: 0.01 m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: 99d0111f01c394540a69064c1a297091, type: 3} m_Mesh: {fileID: 4300000, guid: 99d0111f01c394540a69064c1a297091, type: 3}
--- !u!64 &64080985636031386
MeshCollider:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1457798877047700}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 4300000, guid: e20254b82c40c4a42ac6bcd5dbec68c7, type: 3}
--- !u!64 &64087590311291686 --- !u!64 &64087590311291686
MeshCollider: MeshCollider:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

+ 15
- 0
Assets/LocalPlayer.cs View File

@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LocalPlayer : MonoBehaviour {
public CharacterController charControl;
private void Update()
{
if (!charControl.isGrounded)
{
charControl.SimpleMove(new Vector3(0.0f, -5.0f * Time.deltaTime, 0.0f));
}
}
}

+ 11
- 0
Assets/LocalPlayer.cs.meta View File

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

+ 13
- 0
Assets/Prefabs/RealLocalPlayer.prefab View File

@ -37,6 +37,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 4713031430525266} - component: {fileID: 4713031430525266}
- component: {fileID: 114470274098260950} - component: {fileID: 114470274098260950}
- component: {fileID: 114144325375728200}
- component: {fileID: 114874876091907484} - component: {fileID: 114874876091907484}
- component: {fileID: 143426586791887808} - component: {fileID: 143426586791887808}
m_Layer: 0 m_Layer: 0
@ -206,6 +207,18 @@ AudioListener:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1051260791432954} m_GameObject: {fileID: 1051260791432954}
m_Enabled: 1 m_Enabled: 1
--- !u!114 &114144325375728200
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1067952265812482}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 890fed67893ffdd44a4cef0b351ae1f0, type: 3}
m_Name:
m_EditorClassIdentifier:
charControl: {fileID: 143426586791887808}
--- !u!114 &114470274098260950 --- !u!114 &114470274098260950
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

+ 3
- 2
Assets/Scenes/LobbyScene.unity View File

@ -220,6 +220,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 405724f17a9fdf7498f87dfdb5dbcb9e, type: 3} m_Script: {fileID: 11500000, guid: 405724f17a9fdf7498f87dfdb5dbcb9e, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
playerMan: {fileID: 1535509335}
--- !u!1 &1007511397 --- !u!1 &1007511397
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -356,7 +357,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_AspectMode: 0 m_AspectMode: 0
m_AspectRatio: 4.5044775
m_AspectRatio: 4.2877293
--- !u!1 &1535509334 --- !u!1 &1535509334
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -732,7 +733,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 4.710968}
m_SizeDelta: {x: 70.39752, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1973300969 --- !u!114 &1973300969
MonoBehaviour: MonoBehaviour:

+ 1
- 1
Assets/Scipts/Multiplayer/Client/PlayersManager.cs View File

@ -32,7 +32,7 @@ namespace Multiplayer
public void InstantaiateLocalPlayer() public void InstantaiateLocalPlayer()
{ {
LocalPlayer = GameObject.Instantiate(LocalPlayerPrefab,transform); LocalPlayer = GameObject.Instantiate(LocalPlayerPrefab,transform);
LocalPlayer.transform.position = Vector3.zero;
LocalPlayer.transform.position = Vector3.zero + Vector3.up * 5.0f;
ClientManager.Instance.SendMessage(PlayerMsgID.QueryPosition); ClientManager.Instance.SendMessage(PlayerMsgID.QueryPosition);
} }

+ 1
- 0
Assets/Scipts/Player.cs View File

@ -5,4 +5,5 @@ using UnityEngine;
public class Player : MonoBehaviour { public class Player : MonoBehaviour {
public List<GameObject> dummies; public List<GameObject> dummies;
public Vegetable heldVeggie; public Vegetable heldVeggie;
} }

+ 2
- 0
Assets/Scipts/UI/LobbyUIController.cs View File

@ -4,8 +4,10 @@ using UnityEngine;
public class LobbyUIController : MonoBehaviour { public class LobbyUIController : MonoBehaviour {
public Multiplayer.PlayersManager playerMan;
public void OnClickStartGame() public void OnClickStartGame()
{ {
playerMan.LocalPlayer.GetComponent<LocalPlayer>().enabled = true;
Multiplayer.ClientManager.Instance.SendMessage(Multiplayer.PlayerMsgID.GameStart, new Multiplayer.PlayerMsg(Multiplayer.ClientManager.Instance.ID)); Multiplayer.ClientManager.Instance.SendMessage(Multiplayer.PlayerMsgID.GameStart, new Multiplayer.PlayerMsg(Multiplayer.ClientManager.Instance.ID));
} }
} }

Loading…
Cancel
Save