Clean up lots of different things and add the 'shutdown' command

This commit is contained in:
excitedneon 2017-05-09 13:30:56 +03:00
parent 09c9829973
commit 7a4a380f1a
8 changed files with 140 additions and 211 deletions

View File

@ -38,7 +38,6 @@ GameObject:
- component: {fileID: 4844777526459442}
- component: {fileID: 143753897266899886}
- component: {fileID: 114052379458543858}
- component: {fileID: 114425727123615178}
m_Layer: 0
m_Name: NPC
m_TagString: Untagged
@ -296,18 +295,6 @@ MonoBehaviour:
MovementSpeed: 5
CharacterController: {fileID: 143753897266899886}
Head: {fileID: 4900355877646882}
--- !u!114 &114425727123615178
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1045762529817142}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 710d86ec6d539456abdab57a9b2cc730, type: 3}
m_Name:
m_EditorClassIdentifier:
Character: {fileID: 114052379458543858}
--- !u!143 &143753897266899886
CharacterController:
m_ObjectHideFlags: 1

View File

@ -9,39 +9,19 @@ Prefab:
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1422669118968396}
m_RootGameObject: {fileID: 1297568499365208}
m_IsPrefabParent: 1
--- !u!1 &1367393521135124
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4520621767022338}
- component: {fileID: 20536939017850154}
- component: {fileID: 92520660233702492}
- component: {fileID: 124340644611118174}
- component: {fileID: 81368304954100402}
- component: {fileID: 114681016693450610}
m_Layer: 0
m_Name: First Person Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1422669118968396
--- !u!1 &1297568499365208
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4745034248965832}
- component: {fileID: 143085190839734326}
- component: {fileID: 114120944445797642}
- component: {fileID: 114938129367120120}
- component: {fileID: 4586682446228250}
- component: {fileID: 143869468979164672}
- component: {fileID: 114575501420754388}
- component: {fileID: 114385213279389382}
m_Layer: 0
m_Name: PC
m_TagString: Untagged
@ -49,48 +29,36 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1465407492939198
--- !u!1 &1666724255178126
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4861670299298896}
- component: {fileID: 33142738447108270}
- component: {fileID: 23656274019455490}
- component: {fileID: 4243620059187726}
- component: {fileID: 20678872378488080}
- component: {fileID: 92587472481999408}
- component: {fileID: 124775686376978134}
- component: {fileID: 81660614106265848}
- component: {fileID: 114390919699494652}
m_Layer: 0
m_Name: Nose Mesh
m_TagString: Untagged
m_Name: First Person Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1490563693598740
--- !u!1 &1676210427351718
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4245281122908444}
m_Layer: 0
m_Name: Head
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1497601701666466
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4588854539913692}
- component: {fileID: 33174926914852960}
- component: {fileID: 23574207876753912}
- component: {fileID: 4400199165588268}
- component: {fileID: 33797246170962224}
- component: {fileID: 23436966457259662}
m_Layer: 0
m_Name: Character Mesh
m_TagString: Untagged
@ -98,16 +66,31 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1697572331049850
--- !u!1 &1934077548447990
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4883048021777868}
m_Layer: 0
m_Name: Head
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1938407866563824
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4009996084503600}
- component: {fileID: 33203557376034266}
- component: {fileID: 23978059256364702}
- component: {fileID: 4126889091672100}
- component: {fileID: 33272790934557900}
- component: {fileID: 23982704159771918}
m_Layer: 0
m_Name: Head Mesh
m_TagString: Untagged
@ -115,95 +98,81 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4009996084503600
--- !u!4 &4126889091672100
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1697572331049850}
m_GameObject: {fileID: 1938407866563824}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.75, y: 0.75, z: 0.75}
m_Children: []
m_Father: {fileID: 4245281122908444}
m_Father: {fileID: 4883048021777868}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4245281122908444
--- !u!4 &4243620059187726
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1490563693598740}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.6, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4520621767022338}
- {fileID: 4009996084503600}
- {fileID: 4861670299298896}
m_Father: {fileID: 4745034248965832}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4520621767022338
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1367393521135124}
m_GameObject: {fileID: 1666724255178126}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4245281122908444}
m_Father: {fileID: 4883048021777868}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4588854539913692
--- !u!4 &4400199165588268
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1497601701666466}
m_GameObject: {fileID: 1676210427351718}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.6, z: 0}
m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
m_Children: []
m_Father: {fileID: 4745034248965832}
m_Father: {fileID: 4586682446228250}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4745034248965832
--- !u!4 &4586682446228250
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1422669118968396}
m_GameObject: {fileID: 1297568499365208}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4588854539913692}
- {fileID: 4245281122908444}
- {fileID: 4400199165588268}
- {fileID: 4883048021777868}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4861670299298896
--- !u!4 &4883048021777868
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1465407492939198}
m_LocalRotation: {x: -0.4244356, y: -0, z: -0, w: 0.90545815}
m_LocalPosition: {x: 0, y: 0.024, z: 0.321}
m_LocalScale: {x: 0.2, y: 0.2, z: 0.2}
m_Children: []
m_Father: {fileID: 4245281122908444}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: -50.230003, y: 0, z: 0}
--- !u!20 &20536939017850154
m_GameObject: {fileID: 1934077548447990}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.6, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4243620059187726}
- {fileID: 4126889091672100}
m_Father: {fileID: 4586682446228250}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &20678872378488080
Camera:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1367393521135124}
m_GameObject: {fileID: 1666724255178126}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
@ -234,12 +203,12 @@ Camera:
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!23 &23574207876753912
--- !u!23 &23436966457259662
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1497601701666466}
m_GameObject: {fileID: 1676210427351718}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
@ -266,12 +235,12 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23656274019455490
--- !u!23 &23982704159771918
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1465407492939198}
m_GameObject: {fileID: 1938407866563824}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
@ -298,79 +267,64 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23978059256364702
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1697572331049850}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 915c2edfa28a346cd9231174ce7cbbc8, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 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 &33142738447108270
--- !u!33 &33272790934557900
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1465407492939198}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33174926914852960
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1497601701666466}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33203557376034266
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1697572331049850}
m_GameObject: {fileID: 1938407866563824}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!81 &81368304954100402
--- !u!33 &33797246170962224
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1676210427351718}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!81 &81660614106265848
AudioListener:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1367393521135124}
m_GameObject: {fileID: 1666724255178126}
m_Enabled: 1
--- !u!92 &92520660233702492
--- !u!92 &92587472481999408
Behaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1367393521135124}
m_GameObject: {fileID: 1666724255178126}
m_Enabled: 1
--- !u!114 &114120944445797642
--- !u!114 &114385213279389382
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1422669118968396}
m_GameObject: {fileID: 1297568499365208}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 710d86ec6d539456abdab57a9b2cc730, type: 3}
m_Name:
m_EditorClassIdentifier:
Character: {fileID: 114575501420754388}
--- !u!114 &114390919699494652
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1666724255178126}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ff26db721962cdf4a8edcdfa9a767d2a, type: 3}
m_Name:
m_EditorClassIdentifier:
profile: {fileID: 11400000, guid: 9b37d8da88a424e7b89894da2e5ce5b4, type: 2}
--- !u!114 &114575501420754388
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1297568499365208}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93b3c1d817b2246bda7f93e02de2ea56, type: 3}
@ -378,45 +332,21 @@ MonoBehaviour:
m_EditorClassIdentifier:
ID: 0
MovementSpeed: 5
CharacterController: {fileID: 143085190839734326}
Head: {fileID: 4245281122908444}
--- !u!114 &114681016693450610
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1367393521135124}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ff26db721962cdf4a8edcdfa9a767d2a, type: 3}
m_Name:
m_EditorClassIdentifier:
profile: {fileID: 11400000, guid: 9b37d8da88a424e7b89894da2e5ce5b4, type: 2}
--- !u!114 &114938129367120120
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1422669118968396}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 710d86ec6d539456abdab57a9b2cc730, type: 3}
m_Name:
m_EditorClassIdentifier:
Character: {fileID: 114120944445797642}
--- !u!124 &124340644611118174
CharacterController: {fileID: 143869468979164672}
Head: {fileID: 4883048021777868}
--- !u!124 &124775686376978134
Behaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1367393521135124}
m_GameObject: {fileID: 1666724255178126}
m_Enabled: 1
--- !u!143 &143085190839734326
--- !u!143 &143869468979164672
CharacterController:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1422669118968396}
m_GameObject: {fileID: 1297568499365208}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: e8761b9491a974d1780e60dafbd372a2
timeCreated: 1494323919
timeCreated: 1494325109
licenseType: Free
NativeFormatImporter:
mainObjectFileID: 100100000

View File

@ -450,7 +450,7 @@ GameObject:
- component: {fileID: 605817614}
- component: {fileID: 605817616}
m_Layer: 0
m_Name: World Root
m_Name: WorldRoot
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -468,7 +468,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
SyncDB: {fileID: 605817616}
PCEntityPrefab: {fileID: 1422669118968396, guid: e8761b9491a974d1780e60dafbd372a2,
PCEntityPrefab: {fileID: 1297568499365208, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
NPCEntityPrefab: {fileID: 1045762529817142, guid: 88dbba5a284f041afbfbb6e6f52935fa,
type: 2}

View File

@ -131,6 +131,10 @@ namespace Cyber.Console {
AddCommand("print (text)", "Prints the given text.", (args) => {
Println(args[0]);
});
AddCommand("shutdown", "Shuts the game down.", (args) => {
Application.Quit();
});
}
private void Update() {

View File

@ -32,9 +32,9 @@ namespace Cyber.Controls {
// Handle inputs
Vector3 Move = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
if (Move.sqrMagnitude != 0) {
Character.Move(Character.Head.TransformDirection(Move));
Character.Move(Character.transform.TransformDirection(Move));
Client.Send(PktType.MoveCreature, new MoveCreaturePkt(transform.TransformDirection(Move), Character.ID));
Client.Send(PktType.MoveCreature, new MoveCreaturePkt(Character.transform.TransformDirection(Move), Character.ID));
} else if (Character.Moving()) {
Character.Stop();

View File

@ -48,7 +48,14 @@ namespace Cyber.Entities {
/// </summary>
/// <param name="EulerAngles">Rotation in euler angles.</param>
public void SetRotation(Vector3 EulerAngles) {
Head.localEulerAngles = EulerAngles;
Vector3 HeadRot = Head.localEulerAngles;
HeadRot.x = EulerAngles.x;
HeadRot.z = EulerAngles.z;
Head.localEulerAngles = HeadRot;
Vector3 BodyRot = transform.localEulerAngles;
BodyRot.y = EulerAngles.y;
transform.localEulerAngles = BodyRot;
}
/// <summary>
@ -58,6 +65,16 @@ namespace Cyber.Entities {
return MovementDirection.sqrMagnitude != 0;
}
/// <summary>
/// The character's rotation. Intended to be given as an input to
/// <see cref="SetRotation"/>.
/// </summary>
/// <returns>The rotation.</returns>
public Vector3 GetRotation() {
Vector3 Rotation = new Vector3(Head.localEulerAngles.x,
transform.localEulerAngles.y, Head.localEulerAngles.z);
}
private void FixedUpdate() {
CharacterController.Move(MovementDirection * MovementSpeed * Time.fixedDeltaTime);
}

View File

@ -53,14 +53,5 @@ namespace Cyber.Entities {
}
return Spawned;
}
private void Start() {
}
private void Update() {
if (Input.GetButtonDown("Jump") && !Term.IsVisible()) {
Spawn(EntityType.NPC, new Vector3(Random.Range(-1f, 1f), 0, Random.Range(-2f, 2f)));
}
}
}
}