Added Scene Init Exit events #291

Merged
maverickdgg merged 6 commits from SP3-12-SceneGraph into main 2022-12-06 13:39:58 +08:00
443 changed files with 41465 additions and 9657 deletions
Showing only changes of commit 0bf549f478 - Show all commits

27
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,27 @@
---
name: Bug report
about: Report a bug that should be fixed
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest a feature for the project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

Binary file not shown.

Binary file not shown.

BIN
Assets/Audio/Music.bank Normal file

Binary file not shown.

BIN
Assets/Audio/SFX.bank Normal file

Binary file not shown.

BIN
Assets/Audio/UI.bank Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16

BIN
Assets/Fonts/ALGER.shfont Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: ALGER
ID: 182525173
Type: 10

BIN
Assets/Fonts/ALGER.ttf Normal file

Binary file not shown.

BIN
Assets/Fonts/SegoeUI.shfont Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: SegoeUI
ID: 176667660
Type: 10

BIN
Assets/Fonts/SegoeUI.ttf Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
- VertexShader: 39210065
FragmentShader: 46377769
SubPass: G-Buffer Write
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 61918518
data.alpha: 0
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: HouseMaterial
ID: 127069936
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 39210065
FragmentShader: 46377769
SubPass: G-Buffer Write
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 57342922
data.alpha: 0
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: MT_ColorPaletteDefault
ID: 131956078
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 39210065
FragmentShader: 46377769
SubPass: G-Buffer Write
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 53438927
data.alpha: 0
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: MT_House_Palette4
ID: 132690168
Type: 7

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_HouseInterior_Palette3
ID: 61918518
Type: 3

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: G-Buffer Write
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 54429632
data.alpha: 0
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: UIMat
ID: 129340704
Type: 7

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,28 @@
Name: ExteriorMeshs
ID: 80559352
Type: 4
Sub Assets:
Name: TreeVar1
ID: 150881323
Type: 8
Name: TreeVar2
ID: 140386412
Type: 8
Name: TreeVar3
ID: 146337876
Type: 8
Name: BushVar1
ID: 143461339
Type: 8
Name: BushVar2
ID: 136373407
Type: 8
Name: BushVar3
ID: 144928031
Type: 8
Name: FenceSinglePiece
ID: 140263745
Type: 8
Name: FenceFivePiece
ID: 145842965
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,55 @@
Name: HouseModular
ID: 75328301
Type: 4
Sub Assets:
Name: FloorLarge
ID: 142812576
Type: 8
Name: FloorSmall
ID: 139921228
Type: 8
Name: FloorLong
ID: 136991843
Type: 8
Name: Pillar
ID: 150352316
Type: 8
Name: WallEnd
ID: 139594893
Type: 8
Name: WallCorner
ID: 134714737
Type: 8
Name: WallDefault
ID: 140834166
Type: 8
Name: WallLarge
ID: 142689599
Type: 8
Name: WallDiagonal
ID: 144002377
Type: 8
Name: WallTBlock
ID: 149359798
Type: 8
Name: WindowLarge
ID: 148351779
Type: 8
Name: WindowSmallOpened
ID: 149786048
Type: 8
Name: WindowSmallClosed
ID: 147863396
Type: 8
Name: WindowLargeOpen
ID: 138781993
Type: 8
Name: WallDoorHole
ID: 150924328
Type: 8
Name: Door
ID: 147152385
Type: 8
Name: DoorFrame
ID: 146862321
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,22 @@
Name: KitchenAddOns1
ID: 79971916
Type: 4
Sub Assets:
Name: TallStool01
ID: 140539561
Type: 8
Name: Chair01
ID: 142860936
Type: 8
Name: Table01
ID: 140474147
Type: 8
Name: ServiceTray01
ID: 140279658
Type: 8
Name: RubbishBin01_Body
ID: 143026779
Type: 8
Name: RubbishBin01_Lid
ID: 142134724
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,7 @@
Name: KitchenCounterEmpty
ID: 78136063
Type: 4
Sub Assets:
Name: CupboardEmpty
ID: 144189529
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,55 @@
Name: KitchenCounterMeshs
ID: 82758363
Type: 4
Sub Assets:
Name: DrawerMid01
ID: 139881558
Type: 8
Name: DrawerSmall01
ID: 135779275
Type: 8
Name: DrawerSmall02
ID: 146001396
Type: 8
Name: DrawerSmall03
ID: 150413201
Type: 8
Name: DrawerLarge01
ID: 138305769
Type: 8
Name: DoorLeft
ID: 150547241
Type: 8
Name: DoorRight
ID: 146520338
Type: 8
Name: CupboardSolid
ID: 144974966
Type: 8
Name: DoorDoubleRight
ID: 146717179
Type: 8
Name: CupboardSinkPiece
ID: 141601355
Type: 8
Name: DoorDoubleLeft
ID: 146024338
Type: 8
Name: CupboardSolidBlock
ID: 142281760
Type: 8
Name: CupboardSolidHalf
ID: 137745540
Type: 8
Name: CupboardOven
ID: 136828790
Type: 8
Name: DoorOven
ID: 150740704
Type: 8
Name: DoorOvenGlass
ID: 135623020
Type: 8
Name: OvenTray
ID: 136078992
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,22 @@
Name: KitchenShelves1
ID: 82783113
Type: 4
Sub Assets:
Name: BottomLid
ID: 138181722
Type: 8
Name: TopLid
ID: 147761585
Type: 8
Name: Backcover
ID: 139576452
Type: 8
Name: InBetweenShelf
ID: 142336524
Type: 8
Name: FrameHigh
ID: 150586966
Type: 8
Name: FrameLow
ID: 140066298
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,7 @@
Name: MD_SkyDome01
ID: 82516582
Type: 4
Sub Assets:
Name: Sphere
ID: 144340823
Type: 8

104
Assets/Models/Quad.gltf Normal file
View File

@ -0,0 +1,104 @@
{
"asset" : {
"generator" : "Khronos glTF Blender I/O v3.3.27",
"version" : "2.0"
},
"scene" : 0,
"scenes" : [
{
"name" : "Scene",
"nodes" : [
0
]
}
],
"nodes" : [
{
"mesh" : 0,
"name" : "Quad"
}
],
"meshes" : [
{
"name" : "Plane",
"primitives" : [
{
"attributes" : {
"POSITION" : 0,
"NORMAL" : 1,
"TEXCOORD_0" : 2
},
"indices" : 3
}
]
}
],
"accessors" : [
{
"bufferView" : 0,
"componentType" : 5126,
"count" : 4,
"max" : [
0.5,
0.5,
3.774895063202166e-08
],
"min" : [
-0.5,
-0.5,
-3.774895063202166e-08
],
"type" : "VEC3"
},
{
"bufferView" : 1,
"componentType" : 5126,
"count" : 4,
"type" : "VEC3"
},
{
"bufferView" : 2,
"componentType" : 5126,
"count" : 4,
"type" : "VEC2"
},
{
"bufferView" : 3,
"componentType" : 5123,
"count" : 6,
"type" : "SCALAR"
}
],
"bufferViews" : [
{
"buffer" : 0,
"byteLength" : 48,
"byteOffset" : 0,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 48,
"byteOffset" : 48,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 32,
"byteOffset" : 96,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 12,
"byteOffset" : 128,
"target" : 34963
}
],
"buffers" : [
{
"byteLength" : 140,
"uri" : "data:application/octet-stream;base64,AAAAvwAAAL9pISIzAAAAPwAAAL9pISIzAAAAvwAAAD9pISKzAAAAPwAAAD9pISKzAAAAAGkhojMAAIA/AAAAAGkhojMAAIA/AAAAAGkhojMAAIA/AAAAAGkhojMAAIA/AAAAAAAAgD8AAIA/AACAPwAAAAAAAAAAAACAPwAAAAAAAAEAAwAAAAMAAgA="
}
]
}

BIN
Assets/Models/Quad.shmodel Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
Name: Quad
ID: 80501355
Type: 4
Sub Assets:
Name: Quad
ID: 141771688
Type: 8

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
Name: Environment
ID: 91553073
Type: 5

View File

@ -1,10 +1,10 @@
- EID: 0 - EID: 0
Name: Default Name: Camera
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Camera Component: Camera Component:
Position: {x: 0, y: 0, z: 0} Position: {x: 0, y: 3, z: 8}
Pitch: 0 Pitch: 0
Yaw: 0 Yaw: 0
Roll: 0 Roll: 0
@ -13,6 +13,7 @@
Near: 0.00999999978 Near: 0.00999999978
Far: 10000 Far: 10000
Perspective: true Perspective: true
IsActive: true
Light Component: Light Component:
Position: {x: 0, y: 0, z: 0} Position: {x: 0, y: 0, z: 0}
Type: Directional Type: Directional
@ -20,147 +21,10 @@
Color: {x: 0.951541841, y: 0.921719015, z: 0.553319454, w: 1} Color: {x: 0.951541841, y: 0.921719015, z: 0.553319454, w: 1}
Layer: 4294967295 Layer: 4294967295
Strength: 0 Strength: 0
Scripts: ~
- EID: 1
Name: Default
IsActive: true IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -1.440328, y: -4.41369677, z: -5}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 49.4798889, y: 0.5, z: 17.5}
Renderable Component:
Mesh: 149697411
Material: 126974645
RigidBody Component:
Type: Static
Mass: 1
Drag: 0
Angular Drag: 0
Use Gravity: true
Interpolate: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Scripts: ~
- EID: 2
Name: Player
IsActive: true
NumberOfChildren: 3
Components:
Transform Component:
Translate: {x: -3.06177855, y: -2, z: -5}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 2, y: 2, z: 2}
Renderable Component:
Mesh: 149697411
Material: 126974645
RigidBody Component:
Type: Dynamic
Mass: 1
Drag: 0
Angular Drag: 0
Use Gravity: true
Interpolate: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Scripts: ~
- EID: 3
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0094268322, y: 0, z: 0}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
Scripts: ~
- EID: 4
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
Scripts: ~
- EID: 9
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
Renderable Component:
Mesh: 144838771
Material: 123745521
Scripts: ~
- EID: 6
Name: AI
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -8, y: -2, z: 2.5}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
Renderable Component:
Mesh: 149697411
Material: 126974645
RigidBody Component:
Type: Dynamic
Mass: 1
Drag: 0
Angular Drag: 0
Use Gravity: true
Interpolate: false
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: true
Freeze Rotation Y: true
Freeze Rotation Z: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.5, y: 0.5, z: 0.5}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Scripts: ~ Scripts: ~
- EID: 7 - EID: 7
Name: Default Name: BigBoi
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
@ -168,12 +32,14 @@
Translate: {x: 0, y: -16.8647861, z: -14.039052} Translate: {x: 0, y: -16.8647861, z: -14.039052}
Rotate: {x: -0, y: 0, z: -0} Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 28.1434975, y: 28.1434975, z: 28.1434975} Scale: {x: 28.1434975, y: 28.1434975, z: 28.1434975}
IsActive: true
Renderable Component: Renderable Component:
Mesh: 149697411 Mesh: 149697411
Material: 126974645 Material: 126974645
IsActive: true
Scripts: ~ Scripts: ~
- EID: 8 - EID: 8
Name: Default Name: AmbientLight
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
@ -184,32 +50,18 @@
Color: {x: 1, y: 1, z: 1, w: 1} Color: {x: 1, y: 1, z: 1, w: 1}
Layer: 4294967295 Layer: 4294967295
Strength: 0.25 Strength: 0.25
IsActive: true
Scripts: ~ Scripts: ~
- EID: 5 - EID: 65542
Name: item Name: Default
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -2, z: -5} Translate: {x: 2.5, y: 0.5, z: -2.5}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 2, y: 2, z: 2} Scale: {x: 5, y: 0.5, z: 5}
Renderable Component: IsActive: true
Mesh: 144838771
Material: 123745521
RigidBody Component:
Type: Dynamic
Mass: 1
Drag: 0
Angular Drag: 0
Use Gravity: true
Interpolate: false
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: true
Freeze Rotation Y: true
Freeze Rotation Z: true
Collider Component: Collider Component:
Colliders: Colliders:
- Is Trigger: false - Is Trigger: false
@ -218,12 +70,315 @@
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0.5, z: 0} Position Offset: {x: 0, y: 0, z: 0}
- Is Trigger: true Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65538
Name: Movable
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 4.28833103, z: 0}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Type: Box Type: Box
Half Extents: {x: 2, y: 2, z: 2} Half Extents: {x: 2, y: 2, z: 2}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0.5, z: 0} Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65537
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 5.25, y: 2.75, z: 2.5}
Rotate: {x: 0, y: 0, z: 1.57079637}
Scale: {x: 5, y: 0.5, z: 5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 9
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 5.25, y: 2.75, z: -2.5}
Rotate: {x: 0, y: 0, z: 1.57079637}
Scale: {x: 5, y: 0.5, z: 5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 10
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -5.25, y: 2.75, z: 2.5}
Rotate: {x: 0, y: 0, z: 1.57079637}
Scale: {x: 5, y: 0.5, z: 5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 11
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -5.25, y: 2.75, z: -2.5}
Rotate: {x: 0, y: 0, z: 1.57079637}
Scale: {x: 5, y: 0.5, z: 5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 12
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.5, y: 2.75, z: 5.25}
Rotate: {x: 7.15255737e-07, y: 1.57079566, z: 1.57079589}
Scale: {x: 4.99999809, y: 0.499999762, z: 4.99999809}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65551
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2.5, y: 2.75, z: 5.25}
Rotate: {x: 7.15255737e-07, y: 1.57079566, z: 1.57079589}
Scale: {x: 4.99999809, y: 0.499999762, z: 4.99999809}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65550
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2.5, y: 2.75, z: -5.25}
Rotate: {x: 7.15255737e-07, y: 1.57079566, z: 1.57079589}
Scale: {x: 4.99999809, y: 0.499999762, z: 4.99999809}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65549
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.5, y: 2.75, z: -5.25}
Rotate: {x: 7.15255737e-07, y: 1.57079566, z: 1.57079589}
Scale: {x: 4.99999809, y: 0.499999762, z: 4.99999809}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 16
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 2.5, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 2.5, y: 0.5, z: 2.5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 5
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.5, y: 0.5, z: 2.5}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 5, y: 0.5, z: 5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 4
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2.5, y: 0.5, z: -2.5}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 5, y: 0.5, z: 5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 3
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2.5, y: 0.5, z: 2.5}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 5, y: 0.5, z: 5}
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~ Scripts: ~

8606
Assets/Scenes/MainGame.shade Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
Name: MainGame
ID: 86098106
Type: 5

View File

@ -0,0 +1,57 @@
- EID: 0
Name: Default
IsActive: true
NumberOfChildren: 1
Components: ~
Scripts: ~
- EID: 1
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1920, y: 1080, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 129340704
IsActive: true
Scripts: ~
- EID: 2
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Light Component:
Position: {x: 0, y: 0, z: 0}
Type: Directional
Direction: {x: 0, y: 0, z: 1}
Color: {x: 1, y: 1, z: 1, w: 1}
Layer: 4294967295
Strength: 0
IsActive: true
Scripts: ~
- EID: 3
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
Position: {x: 0, y: 0, z: 0}
Pitch: 0
Yaw: 0
Roll: 0
Width: 1920
Height: 1080
Near: 0.00999999978
Far: 10000
Perspective: true
IsActive: true
Scripts: ~

View File

@ -0,0 +1,3 @@
Name: MainMenu
ID: 97158628
Type: 5

View File

@ -0,0 +1,469 @@
- EID: 0
Name: ScoreZone
IsActive: true
NumberOfChildren: 0
Components:
Camera Component:
Position: {x: 0, y: 0, z: 0}
Pitch: 0
Yaw: 0
Roll: 0
Width: 1920
Height: 1080
Near: 0.00999999978
Far: 10000
Perspective: true
IsActive: true
Light Component:
Position: {x: 0, y: 0, z: 0}
Type: Directional
Direction: {x: 1.79999995, y: 0, z: 1}
Color: {x: 0.951541841, y: 0.921719015, z: 0.553319454, w: 1}
Layer: 4294967295
Strength: 0
IsActive: true
Scripts: ~
- EID: 1
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -1.440328, y: -4.41369677, z: -5}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 49.4798889, y: 0.5, z: 17.5}
IsActive: true
Renderable Component:
Mesh: 149697411
Material: 126974645
IsActive: true
RigidBody Component:
Type: Static
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 2
Name: Player
IsActive: true
NumberOfChildren: 3
Components:
Transform Component:
Translate: {x: -0.0897406489, y: -4.07369709, z: 3.6087606}
Rotate: {x: 0, y: -0.19268477, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 149697411
Material: 126974645
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 2
Angular Drag: 0
Use Gravity: false
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: true
Freeze Rotation Y: true
Freeze Rotation Z: true
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.5, y: 0.699999988, z: 0.5}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.300000012, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: PlayerController
currentState: 0
maxMoveVel: 4
moveForce: 50
sprintMultiplier: 1.5
rotationFactorPerFrame: 4
maxJumpHeight: 4
maxJumpTime: 0.75
fallMultipler: 2
lightMultiper: 0.75
mediumMultiper: 0.5
heavyMultiper: 0.25
- Type: PickAndThrow
throwForce: [300, 300, 300]
delayTimer: 1
aimingLength: 1.5
- Type: StateMachine
currentStateName: Idle State
currentAnimName: ""
- EID: 3
Name: HoldingPoint
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 1.20000005, z: 0.5}
Rotate: {x: 0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 4
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: -0.361278683, y: 4.97423792, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
Position: {x: 0.330392599, y: -2.72767258, z: 5.02710676}
Pitch: -42.2981491
Yaw: 16.4989166
Roll: 0
Width: 1920
Height: 1080
Near: 0.00999999978
Far: 10000
Perspective: true
IsActive: true
Scripts:
- Type: SHADE_Scripting.ThirdPersonCamera
armLength: 2
turnSpeedPitch: 0.300000012
turnSpeedYaw: 0.5
pitchClamp: 45
- EID: 9
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 144838771
Material: 123745521
IsActive: true
Scripts: ~
- EID: 6
Name: AI
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -8, y: -4.42369699, z: 3.65323806}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 149697411
Material: 126974645
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0
Angular Drag: 0
Use Gravity: true
Interpolate: false
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: true
Freeze Rotation Y: true
Freeze Rotation Z: true
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.5, y: 0.5, z: 0.5}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 7
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: -16.8647861, z: -14.039052}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 28.1434975, y: 28.1434975, z: 28.1434975}
IsActive: true
Renderable Component:
Mesh: 149697411
Material: 126974645
IsActive: true
Scripts: ~
- EID: 8
Name: Default
IsActive: true
NumberOfChildren: 0
Components:
Light Component:
Position: {x: 0, y: 0, z: 0}
Type: Ambient
Direction: {x: 0, y: 0, z: 1}
Color: {x: 1, y: 1, z: 1, w: 1}
Layer: 4294967295
Strength: 0.25
IsActive: true
Scripts: ~
- EID: 11
Name: GameManager
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
RigidBody Component:
Type: Static
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders: ~
IsActive: true
Scripts:
- Type: GameManager
itemPool: 12
zonePool: 15
currGameState: 3
totalItemCount: 2
Score: 0
timer: 4.00741768
- EID: 12
Name: ItemPool
IsActive: true
NumberOfChildren: 2
Components: ~
Scripts: ~
- EID: 10
Name: item
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 3.19896913, y: -3.66431332, z: -4.99997139}
Rotate: {x: -1.57956983e-05, y: 2.20007223e-06, z: -0.000548519194}
Scale: {x: 2, y: 2, z: 2}
IsActive: true
Renderable Component:
Mesh: 144838771
Material: 123745521
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.100000001
Angular Drag: 0.100000001
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: true
Type: Box
Half Extents: {x: 2, y: 2, z: 2}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Item
Score: 1
currCategory: 0
- EID: 5
Name: item
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -5.02078056, y: -4.17369747, z: -2.14891005}
Rotate: {x: -2.95397289e-08, y: 0.00065473502, z: -4.44611992e-08}
Scale: {x: 1.99998975, y: 2, z: 1.99998975}
IsActive: true
Renderable Component:
Mesh: 144838771
Material: 123745521
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.100000001
Angular Drag: 0.100000001
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.5, y: 0.5, z: 0.5}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: true
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Item
Score: 1
currCategory: 0
- EID: 15
Name: ScoreZonePool
IsActive: true
NumberOfChildren: 2
Components: ~
Scripts: ~
- EID: 13
Name: ScoreZone
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -24.4654179, y: -3.15127993, z: -3.29243231}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
RigidBody Component:
Type: Static
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: true
Type: Box
Half Extents: {x: 1, y: 20, z: 20}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: ScoringZone
- EID: 14
Name: ScoreZone
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -6.64785767, y: 0, z: -14.217104}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
RigidBody Component:
Type: Static
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: true
Type: Box
Half Extents: {x: 20, y: 20, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: ScoringZone

View File

@ -0,0 +1,3 @@
Name: PlayerControllerTest
ID: 92100024
Type: 5

View File

@ -51,7 +51,6 @@ public class AIPrototype : Script
private GameObject? player; private GameObject? player;
public AIPrototype(GameObject gameObj) : base(gameObj) { }
protected override void awake() protected override void awake()
{ {

View File

@ -0,0 +1,3 @@
Name: AIPrototype
ID: 163215061
Type: 9

View File

@ -7,7 +7,6 @@ namespace SHADE_Scripting
{ {
public float turnSpeed = 0.5f; public float turnSpeed = 0.5f;
public CameraControl(GameObject go) : base(go) { }
protected override void update() protected override void update()
{ {
//Camera //Camera

View File

@ -0,0 +1,3 @@
Name: CameraControl
ID: 158782344
Type: 9

View File

@ -0,0 +1,180 @@
using SHADE;
using SHADE_Scripting;
using System;
using static PlayerController;
public class PickAndThrow : Script
{
public Vector3 throwForce = new Vector3(100.0f, 200.0f, 100.0f);
public GameObject item { get; set; }
public float delayTimer = 1.0f;
public float aimingLength = 1.5f;
private float timer;
private PlayerController pc;
private Camera cam;
private Transform itemTransform;
private RigidBody itemRidibody;
private Transform raccoonHoldLocation;
private Transform playerTran;
private ThirdPersonCamera tpc;
private float lastXDir;
private float lastZDir;
private bool inRange = false;
protected override void awake()
{
playerTran = GetComponent<Transform>();
if (!playerTran)
Debug.Log("PLAYERTRANSFORM EMPTY"); ;
pc = GetScript<PlayerController>();
if(!pc)
Debug.Log("PLAYER CONTROLLER EMPTY");
raccoonHoldLocation = GetComponentInChildren<Transform>();
if (!raccoonHoldLocation)
Debug.Log("CHILD EMPTY");
tpc = GetScriptInChildren<ThirdPersonCamera>();
if(!tpc)
Debug.Log("TPC EMPTY");
timer = delayTimer;
}
protected override void update()
{
if(timer <= delayTimer)
timer += Time.DeltaTimeF;
CalculateDir();
if (pc && itemRidibody && itemTransform)
{
if (pc.holdItem)
{
itemTransform.LocalPosition = raccoonHoldLocation.GlobalPosition;
itemTransform.LocalRotation = playerTran.LocalRotation;
if (Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
{
Debug.Log("AIMING");
pc.isAiming = true;
pc.camArm.ArmLength = aimingLength;
}
if (Input.GetMouseButtonUp(Input.MouseCode.LeftButton) && pc.isAiming)
{
Audio.PlayBGMOnce2D("event:/Raccoon/raccoon_throw");
pc.isAiming = false;
if(tpc)
pc.camArm.ArmLength = tpc.armLength;
pc.holdItem = false;
inRange = false;
itemRidibody.IsGravityEnabled = true;
itemRidibody.AddForce(new Vector3(throwForce.x * lastXDir, throwForce.y, throwForce.z * lastZDir));
itemRidibody.LinearVelocity += pc.rb.LinearVelocity;
ResetItemObject();
timer = 0.0f;
}
if (Input.GetMouseButtonDown(Input.MouseCode.RightButton))
{
pc.holdItem = false;
inRange = false;
itemRidibody.IsGravityEnabled = true;
ResetItemObject();
}
}
else if (!pc.holdItem)
itemRidibody.IsGravityEnabled = true;
}
if (timer > delayTimer && pc && !pc.holdItem && inRange && Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
{
if (pc.currentState == RaccoonStates.WALKING || pc.currentState == RaccoonStates.IDLE)
{
pc.holdItem = true;
RetrieveItemComponets();
}
}
}
private void ResetItemObject()
{
itemRidibody = null;
itemTransform = null;
item = new GameObject();
}
private void RetrieveItemComponets()
{
//get the transform of the given item
if (item.GetScript<Item>() && itemTransform == null && itemRidibody == null)
{
itemRidibody = item.GetComponent<RigidBody>();
if (itemRidibody == null)
Debug.Log("Item rb EMPTY");
else
{
itemRidibody.IsGravityEnabled = false;
itemRidibody.LinearVelocity = Vector3.Zero;
itemRidibody.AngularVelocity = Vector3.Zero;
}
itemTransform = item.GetComponent<Transform>();
if (itemTransform == null)
Debug.Log("Item transform EMPTY");
else
{
itemTransform.LocalEulerAngles = Vector3.Zero;
}
}
}
private void CalculateDir()
{
if (cam == null)
cam = GetComponentInChildren<Camera>();
else if (cam)
{
Vector3 camerAixs = cam.GetForward();
camerAixs.y = 0;
camerAixs.Normalise();
lastXDir = camerAixs.x;
lastZDir = camerAixs.z;
}
}
private void DelayCheck()
{
timer += Time.DeltaTimeF;
}
protected override void onCollisionEnter(CollisionInfo info)
{
}
protected override void onTriggerEnter(CollisionInfo info)
{
if (info.GameObject.GetScript<Item>() && !pc.holdItem)
{
item = info.GameObject;
inRange = true;
}
}
protected override void onTriggerStay(CollisionInfo info)
{
//Debug.Log("STAY");
}
protected override void onTriggerExit(CollisionInfo info)
{
//Debug.Log("EXIT");
if (info.GameObject.GetScript<Item>() != null && !pc.holdItem)
{
inRange = false;
}
}
}

View File

@ -0,0 +1,3 @@
Name: SC_PickAndThrow
ID: 154802724
Type: 9

View File

@ -1,40 +1,49 @@
using SHADE; using SHADE;
using System; using System;
using System.Collections.Generic;
using static Item; using static Item;
public class PlayerController : Script public class PlayerController : Script
{ {
public enum RaccoonStates public enum RaccoonStates
{ {
IDILE, IDLE,
WALKING, WALKING,
RUNNING, RUNNING,
JUMP, JUMP,
FALLING, FALLING,
LANDED,
CAUGHT, CAUGHT,
TOTAL TOTAL
} }
public enum WalkingState
{
CARRY,
AIMING,
THROW,
WALK,
TOTAL
}
public RigidBody rb { get; set; } public RigidBody rb { get; set; }
private Transform tranform; private Transform tranform;
private Camera cam; private Camera cam;
public CameraArm camArm { get; set; }
private PickAndThrow pat; private PickAndThrow pat;
private StateMachine stateMachine;
//to be remove
public float drag = 2.0f;
public bool holdItem { get; set; } public bool holdItem { get; set; }
[SerializeField] public bool isAiming { get; set; }
[Tooltip("The current state fo the raccoon")] [Tooltip("The current state fo the raccoon")]
public RaccoonStates currentState = RaccoonStates.IDILE; public RaccoonStates currentState = RaccoonStates.IDLE;
//Movement variables============================================================ //Movement variables============================================================
[SerializeField]
[Tooltip("Max vel for walking")] [Tooltip("Max vel for walking")]
public float maxMoveVel = 2.0f; public float maxMoveVel = 2.0f;
[SerializeField]
[Tooltip("how much force is apply for walking")] [Tooltip("how much force is apply for walking")]
public float moveForce = 50.0f; public float moveForce = 2.0f;
[SerializeField]
[Tooltip("increase the moveForce and maxMoveVel by its amt")] [Tooltip("increase the moveForce and maxMoveVel by its amt")]
public float sprintMultiplier = 2.0f; public float sprintMultiplier = 2.0f;
@ -42,25 +51,18 @@ public class PlayerController : Script
private float maxOldVel; private float maxOldVel;
private bool sprintIncreaseOnce = false; private bool sprintIncreaseOnce = false;
public float xAxisMove { get; set; }
public float zAxisMove { get; set; }
public Vector2 axisMove { get; set; } public Vector2 axisMove { get; set; }
public bool isMoveKeyPress { get; set; } public bool isMoveKeyPress { get; set; }
[SerializeField] [Tooltip("How fast player will turn")]
[Tooltip("curr not working")]
public float rotationFactorPerFrame = 1.0f; public float rotationFactorPerFrame = 1.0f;
//Jumping vars================================================================== //Jumping vars==================================================================
[SerializeField]
[Tooltip("max height of the jump")] [Tooltip("max height of the jump")]
public float maxJumpHeight = 4.0f; public float maxJumpHeight = 4.0f;
[SerializeField]
[Tooltip("max amt of time it will take for the jump")] [Tooltip("max amt of time it will take for the jump")]
public float maxJumpTime = 0.75f; public float maxJumpTime = 0.75f;
[SerializeField]
[Tooltip("increase gravity when falling")] [Tooltip("increase gravity when falling")]
public float fallMultipler = 2.0f; public float fallMultipler = 2.0f;
private float initialJumpVel; private float initialJumpVel;
@ -69,17 +71,19 @@ public class PlayerController : Script
private float groundGravity = -0.5f; private float groundGravity = -0.5f;
//ItemMultipler================================================================== //ItemMultipler==================================================================
[Tooltip("How light item will affect player jump")]
public float lightMultiper = 0.75f; public float lightMultiper = 0.75f;
[Tooltip("How medium item will affect player jump")]
public float mediumMultiper = 0.5f; public float mediumMultiper = 0.5f;
[Tooltip("How heavy item will affect player jump")]
public float heavyMultiper = 0.25f; public float heavyMultiper = 0.25f;
public PlayerController(GameObject gameObj) : base(gameObj) { }
protected override void awake() protected override void awake()
{ {
//default setup //default setup
isMoveKeyPress = false; isMoveKeyPress = false;
holdItem = false; holdItem = false;
isAiming = false;
//Jump setup //Jump setup
float timeToApex = maxJumpTime / 2; float timeToApex = maxJumpTime / 2;
@ -90,146 +94,126 @@ public class PlayerController : Script
rb = GetComponent<RigidBody>(); rb = GetComponent<RigidBody>();
if (rb == null) if (rb == null)
Debug.LogError("RigidBody is NULL!"); Debug.LogError("RigidBody is NULL!");
else
{
rb.IsGravityEnabled = false;
rb.FreezeRotationX = true;
rb.FreezeRotationY = true;
rb.FreezeRotationZ = true;
rb.Drag = drag;
rb.Interpolating = false;
}
//Transform check //Transform check
tranform = GetComponent<Transform>(); tranform = GetComponent<Transform>();
if(tranform == null) if(tranform == null)
Debug.LogError("tranform is NULL!"); Debug.LogError("tranform is NULL!");
//PickAndThrow checl //PickAndThrow check
pat = GetScript<PickAndThrow>(); pat = GetScript<PickAndThrow>();
if (pat == null) if (pat == null)
Debug.LogError("PickAndThrow is NULL!"); Debug.LogError("PickAndThrow is NULL!");
//toRemove stateMachine = AddScript<StateMachine>();
tranform.LocalPosition = new Vector3(-3.0f, -2.0f, -5.0f); Dictionary<Type, BaseState> dictionary = new Dictionary<Type, BaseState>();
tranform.LocalRotation = Quaternion.Euler(0.0f, 0.0f, 0.0f); dictionary.Add(typeof(PlayerIdleState), new PlayerIdleState(stateMachine));
dictionary.Add(typeof(PlayerWalkState), new PlayerWalkState(stateMachine));
dictionary.Add(typeof(PlayerRunState), new PlayerRunState(stateMachine));
dictionary.Add(typeof(PlayerJumpState), new PlayerJumpState(stateMachine));
dictionary.Add(typeof(PlayerFallState), new PlayerFallState(stateMachine));
dictionary.Add(typeof(PlayerLandState), new PlayerLandState(stateMachine));
dictionary.Add(typeof(PlayerCaughtState), new PlayerCaughtState(stateMachine));
stateMachine.InitStateMachine(dictionary);
} }
protected override void update() protected override void update()
{ {
if (cam == null) if (!cam)
cam = GetComponentInChildren<Camera>(); cam = GetComponentInChildren<Camera>();
if(!camArm)
camArm = GetComponentInChildren<CameraArm>();
//toRemove Rotation();
if (Input.GetKey(Input.KeyCode.G))
{
tranform.LocalRotation = Quaternion.Euler(0.0f, 0.0f, 0.0f);
tranform.LocalPosition = new Vector3(-3.0f, -2.0f, -5.0f);
}
GotCaught(); GotCaught();
MoveKey(); //Debug.Log($"{currentState}");
//Debug.Log($" axisX: {axisMove.x} axisY:{axisMove.y}");
//Debug.Log($"X: {rb.LinearVelocity.x}" + $" Z: {rb.LinearVelocity.z}");
//Debug.Log(currentState.ToString() + " x:" + rb.LinearVelocity.x.ToString() + " y:" + rb.LinearVelocity.y.ToString() + " z:" + rb.LinearVelocity.z.ToString()); //Debug.Log(currentState.ToString() + " x:" + rb.LinearVelocity.x.ToString() + " y:" + rb.LinearVelocity.y.ToString() + " z:" + rb.LinearVelocity.z.ToString());
} }
protected override void fixedUpdate() protected override void fixedUpdate()
{ {
//Rotation(); MoveKey();
Move(); Move();
Sprint(); Sprint();
Jump(); Jump();
Gravity(); Gravity();
//Debug.Log($"X: {rb.LinearVelocity.x}" + $" Z: {rb.LinearVelocity.z}");
} }
private void MoveKey() private void MoveKey()
{ {
/* if (Input.GetKey(Input.KeyCode.A))
xAxisMove = -1;
else if (Input.GetKey(Input.KeyCode.D))
xAxisMove = 1;
else
xAxisMove = 0;
if (Input.GetKey(Input.KeyCode.W))
zAxisMove = -1;
else if (Input.GetKey(Input.KeyCode.S))
zAxisMove = 1;
else
zAxisMove = 0;*/
xAxisMove = 0;
zAxisMove = 0;
axisMove = Vector2.Zero; axisMove = Vector2.Zero;
if (Input.GetKey(Input.KeyCode.W)) if (Input.GetKey(Input.KeyCode.W))
{ {
Vector3 camerAixs = cam.GetForward(); Vector3 camerAixs = cam.GetForward();
camerAixs.y = 0; camerAixs.y = 0;
camerAixs.Normalise(); camerAixs.Normalise();
xAxisMove = camerAixs.x;
zAxisMove = camerAixs.z;
axisMove += new Vector2(camerAixs.x, camerAixs.z); axisMove += new Vector2(camerAixs.x, camerAixs.z);
} }
if (Input.GetKey(Input.KeyCode.S)) if (Input.GetKey(Input.KeyCode.S))
{ {
Vector3 camerAixs = cam.GetForward(); Vector3 camerAixs = cam.GetForward();
camerAixs.y = 0; camerAixs.y = 0;
camerAixs.Normalise(); camerAixs.Normalise();
xAxisMove = -camerAixs.x;
zAxisMove = -camerAixs.z;
axisMove -= new Vector2(camerAixs.x, camerAixs.z); axisMove -= new Vector2(camerAixs.x, camerAixs.z);
} }
if (Input.GetKey(Input.KeyCode.A)) if (Input.GetKey(Input.KeyCode.A))
{ {
Vector3 camerAixs = cam.GetRight(); Vector3 camerAixs = cam.GetRight();
camerAixs.y = 0; camerAixs.y = 0;
camerAixs.Normalise(); camerAixs.Normalise();
xAxisMove = -camerAixs.x;
zAxisMove = -camerAixs.z;
axisMove -= new Vector2(camerAixs.x, camerAixs.z); axisMove -= new Vector2(camerAixs.x, camerAixs.z);
} }
if (Input.GetKey(Input.KeyCode.D)) if (Input.GetKey(Input.KeyCode.D))
{ {
Vector3 camerAixs = cam.GetRight(); Vector3 camerAixs = cam.GetRight();
camerAixs.y = 0; camerAixs.y = 0;
camerAixs.Normalise(); camerAixs.Normalise();
xAxisMove = camerAixs.x;
zAxisMove = camerAixs.z;
axisMove += new Vector2(camerAixs.x, camerAixs.z); axisMove += new Vector2(camerAixs.x, camerAixs.z);
} }
axisMove.Normalise();
isMoveKeyPress = xAxisMove != 0 || zAxisMove != 0;
if(isMoveKeyPress && currentState != RaccoonStates.RUNNING && isGrounded) axisMove.Normalise();
isMoveKeyPress = axisMove.x != 0 || axisMove.y != 0;
if (isMoveKeyPress && isGrounded && !Input.GetKey(Input.KeyCode.LeftShift))
{
currentState = RaccoonStates.WALKING; currentState = RaccoonStates.WALKING;
if(stateMachine && !stateMachine.IsState(typeof(PlayerWalkState)))
stateMachine.SetState(typeof(PlayerWalkState));
}
if (!isMoveKeyPress && isGrounded) if (!isMoveKeyPress && isGrounded)
currentState = RaccoonStates.IDILE; {
currentState = RaccoonStates.IDLE;
if(stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
stateMachine.SetState(typeof(PlayerIdleState));
}
} }
private void Move() private void Move()
{ {
if (rb != null) if (rb != null)
{ {
rb.AddForce(new Vector3(axisMove.x, 0.0f,axisMove.y) * moveForce); rb.LinearVelocity += new Vector3(axisMove.x * moveForce, 0.0f, axisMove.y * moveForce) * Time.DeltaTimeF;
if (isMoveKeyPress) if (isMoveKeyPress && rb)
{ {
if (rb.LinearVelocity.x > maxMoveVel || rb.LinearVelocity.x < -maxMoveVel) Vector3 velNor = rb.LinearVelocity;
velNor.y = 0.0f;
if (velNor.GetMagnitude() > maxMoveVel)
{ {
Vector3 v = rb.LinearVelocity; velNor.Normalise();
v.x = System.Math.Clamp(v.x, -maxMoveVel, maxMoveVel); velNor *= maxMoveVel;
rb.LinearVelocity = v; rb.LinearVelocity = new Vector3(velNor.x, rb.LinearVelocity.y, velNor.z);
}
if (rb.LinearVelocity.z > maxMoveVel || rb.LinearVelocity.z < -maxMoveVel)
{
Vector3 v = rb.LinearVelocity;
v.z = System.Math.Clamp(v.z, -maxMoveVel, maxMoveVel);
rb.LinearVelocity = v;
} }
} }
} }
@ -240,6 +224,9 @@ public class PlayerController : Script
if (Input.GetKey(Input.KeyCode.LeftShift) && isMoveKeyPress && isGrounded) if (Input.GetKey(Input.KeyCode.LeftShift) && isMoveKeyPress && isGrounded)
{ {
currentState = RaccoonStates.RUNNING; currentState = RaccoonStates.RUNNING;
if (stateMachine && !stateMachine.IsState(typeof(PlayerRunState)))
stateMachine.SetState(typeof(PlayerRunState));
holdItem = false; holdItem = false;
if (!sprintIncreaseOnce) if (!sprintIncreaseOnce)
{ {
@ -254,8 +241,12 @@ public class PlayerController : Script
if (Input.GetKeyUp(Input.KeyCode.LeftShift)) if (Input.GetKeyUp(Input.KeyCode.LeftShift))
{ {
if(isMoveKeyPress) if (isMoveKeyPress)
{
currentState = RaccoonStates.WALKING; currentState = RaccoonStates.WALKING;
if(stateMachine && !stateMachine.IsState(typeof(PlayerWalkState)))
stateMachine.SetState(typeof(PlayerWalkState));
}
sprintIncreaseOnce = false; sprintIncreaseOnce = false;
moveForce = oldForce; moveForce = oldForce;
maxMoveVel = maxOldVel; maxMoveVel = maxOldVel;
@ -265,46 +256,45 @@ public class PlayerController : Script
//press and hold jump //press and hold jump
private void Jump() private void Jump()
{ {
if (currentState == RaccoonStates.WALKING || currentState == RaccoonStates.RUNNING || currentState == RaccoonStates.IDILE) if (currentState == RaccoonStates.WALKING || currentState == RaccoonStates.RUNNING || currentState == RaccoonStates.IDLE)
{ {
if (Input.GetKeyDown(Input.KeyCode.Space) && isGrounded && rb != null) if (Input.GetKeyDown(Input.KeyCode.Space) && isGrounded && rb != null)
{ {
currentState = RaccoonStates.JUMP; currentState = RaccoonStates.JUMP;
Vector3 v = rb.LinearVelocity; Vector3 v = rb.LinearVelocity;
v.y = initialJumpVel * 0.5f; v.y = initialJumpVel * 0.5f;
if (pat != null && pat.item.GetScript<Item>() != null && holdItem) if (holdItem && pat != null && pat.item.GetScript<Item>() != null)
{ {
Item item = pat.item.GetScript<Item>(); Item item = pat.item.GetScript<Item>();
if (item.currCategory == ItemCategory.LIGHT) if (item != null && item.currCategory == ItemCategory.LIGHT)
v.y *= lightMultiper; v.y *= lightMultiper;
if (item.currCategory == ItemCategory.MEDIUM) if (item != null && item.currCategory == ItemCategory.MEDIUM)
v.y *= mediumMultiper; v.y *= mediumMultiper;
if (item.currCategory == ItemCategory.HEAVY) if (item != null && item.currCategory == ItemCategory.HEAVY)
v.y *= heavyMultiper; v.y *= heavyMultiper;
} }
rb.LinearVelocity = v; rb.LinearVelocity = v;
} }
} }
if(rb != null && !isGrounded && (rb.LinearVelocity.y < 0.0f || Input.GetKeyUp(Input.KeyCode.Space))) if(!isGrounded && rb != null && (rb.LinearVelocity.y < 0.0f || Input.GetKeyUp(Input.KeyCode.Space)))
currentState = RaccoonStates.FALLING; currentState = RaccoonStates.FALLING;
} }
private void Rotation() private void Rotation()
{ {
Vector3 poitionToLookAt; if (isMoveKeyPress && tranform && !isAiming)
poitionToLookAt.x = xAxisMove;
poitionToLookAt.y = 0.0f;
poitionToLookAt.z = zAxisMove;
if (tranform != null)
{ {
Quaternion currentRotation = tranform.LocalRotation; Quaternion currentRotation = tranform.LocalRotation;
if (currentState == RaccoonStates.WALKING || currentState == RaccoonStates.RUNNING) Quaternion targetRotation = Quaternion.LookRotation(new Vector3(axisMove.x, 0.0f, axisMove.y), new Vector3(0.0f, 1.0f, 0.0f));
{
Quaternion targetRotation = Quaternion.LookRotation(poitionToLookAt, new Vector3(0.0f, 1.0f, 0.0f));
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.DeltaTime); tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.DeltaTime);
} }
else if (camArm && tranform && isAiming)
{
Quaternion currentRotation = tranform.LocalRotation;
Quaternion targetRotation = Quaternion.Euler(0.0f, SHADE.Math.DegreesToRadians(camArm.Yaw + 180.0f), 0.0f);
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.DeltaTime);
} }
} }
@ -314,7 +304,11 @@ public class PlayerController : Script
{ {
//check player vel.y if its close to zero its on the ground //check player vel.y if its close to zero its on the ground
if (SHADE.Math.CompareFloat(rb.LinearVelocity.y, 0.0f)) if (SHADE.Math.CompareFloat(rb.LinearVelocity.y, 0.0f))
{
isGrounded = true; isGrounded = true;
if (currentState == RaccoonStates.FALLING)
currentState = RaccoonStates.LANDED;
}
else else
isGrounded = false; isGrounded = false;
@ -346,7 +340,9 @@ public class PlayerController : Script
{ {
if (currentState == RaccoonStates.CAUGHT && tranform != null) if (currentState == RaccoonStates.CAUGHT && tranform != null)
{ {
currentState = RaccoonStates.IDILE; currentState = RaccoonStates.IDLE;
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
stateMachine.SetState(typeof(PlayerIdleState));
tranform.LocalPosition = new Vector3(-3.0f, -2.0f, -5.0f); tranform.LocalPosition = new Vector3(-3.0f, -2.0f, -5.0f);
} }
} }
@ -355,6 +351,5 @@ public class PlayerController : Script
{ {
} }
} }

View File

@ -0,0 +1,3 @@
Name: SC_PlayerController
ID: 160432754
Type: 9

View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SHADE;
namespace SHADE_Scripting
{
public class ThirdPersonCamera : Script
{
public float armLength = 2.0f;
public float turnSpeedPitch = 0.3f;
public float turnSpeedYaw = 0.5f;
public float pitchClamp = 45.0f;
protected override void awake()
{
AddComponent<Transform>();
if (!GetComponent<Camera>())
{
AddComponent<Camera>();
}
GetComponent<Camera>().SetMainCamera();
if (!GetComponent<CameraArm>())
{
AddComponent<CameraArm>();
}
GetComponent<CameraArm>().ArmLength = armLength;
}
protected override void update()
{
CameraArm arm = GetComponent<CameraArm>();
if (arm)
{
Vector2 vel = Input.GetMouseVelocity();
arm.Pitch -= vel.y * turnSpeedPitch * Time.DeltaTimeF;
arm.Yaw += vel.x * turnSpeedYaw * Time.DeltaTimeF;
if (arm.Pitch > pitchClamp)
{
arm.Pitch = pitchClamp;
}
else if (arm.Pitch < 0)
{
arm.Pitch = 0;
}
}
}
}
}

View File

@ -0,0 +1,3 @@
Name: ThirdPersonCamera
ID: 154161201
Type: 9

View File

@ -0,0 +1,31 @@
using SHADE;
using System;
public class PlayerCaughtState : BaseState
{
public PlayerCaughtState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Caught State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
}
public override void update()
{
//Debug.Log("WALKING");
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}

View File

@ -0,0 +1,3 @@
Name: UT_PlayerCaughtState
ID: 162030736
Type: 9

View File

@ -0,0 +1,31 @@
using SHADE;
using System;
public class PlayerFallState : BaseState
{
public PlayerFallState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Fall State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
}
public override void update()
{
//Debug.Log("WALKING");
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}

View File

@ -0,0 +1,3 @@
Name: UT_PlayerFallState
ID: 155635109
Type: 9

View File

@ -0,0 +1,31 @@
using SHADE;
using System;
public class PlayerIdleState : BaseState
{
public PlayerIdleState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Idle State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
}
public override void update()
{
//Debug.Log("WALKING");
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}

View File

@ -0,0 +1,3 @@
Name: UT_PlayerIdleState
ID: 167587808
Type: 9

View File

@ -0,0 +1,31 @@
using SHADE;
using System;
public class PlayerJumpState : BaseState
{
public PlayerJumpState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Jump State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
}
public override void update()
{
//Debug.Log("WALKING");
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}

View File

@ -0,0 +1,3 @@
Name: UT_PlayerJumpState
ID: 158874227
Type: 9

View File

@ -0,0 +1,31 @@
using SHADE;
using System;
public class PlayerLandState : BaseState
{
public PlayerLandState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Land State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
}
public override void update()
{
//Debug.Log("WALKING");
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}

View File

@ -0,0 +1,3 @@
Name: UT_PlayerLandState
ID: 151865541
Type: 9

View File

@ -0,0 +1,41 @@
using SHADE;
using System;
public class PlayerRunState : BaseState
{
private float timer;
private float delay = 0.25f;
public PlayerRunState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Run State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
}
public override void update()
{
//Debug.Log("WALKING");
timer += Time.DeltaTimeF;
if (timer > delay)
{
Audio.PlayBGMOnce2D("event:/Raccoon/raccoon_footsteps");
timer = 0;
}
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}

View File

@ -0,0 +1,3 @@
Name: UT_PlayerRunState
ID: 153407272
Type: 9

View File

@ -0,0 +1,41 @@
using SHADE;
using System;
public class PlayerWalkState : BaseState
{
private float timer;
private float delay = 0.5f;
public PlayerWalkState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Walk State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
timer = delay;
}
public override void update()
{
//Debug.Log("WALKING");
timer += Time.DeltaTimeF;
if (timer > delay)
{
Audio.PlayBGMOnce2D("event:/Raccoon/raccoon_footsteps");
timer = 0;
}
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}

View File

@ -0,0 +1,3 @@
Name: UT_PlayerWalkState
ID: 166650679
Type: 9

View File

@ -0,0 +1,67 @@
using SHADE;
using System;
using System.Collections.Generic;
public class GameManager : Script
{
public enum GameState
{
MAINMENU,
START,
WIN,
LOSE,
TOTAL
}
public GameObject itemPool;
public GameObject zonePool;
public GameState currGameState;
[NonSerialized]
public int totalItemCount;
[NonSerialized]
public int Score;
[NonSerialized]
public float timer;
private IEnumerable<Item> listOfItems;
private IEnumerable<ScoringZone> listOfZone;
protected override void awake()
{
totalItemCount = 0;
Score = 0;
currGameState = GameState.MAINMENU;
if (itemPool)
{
listOfItems = itemPool.GetScriptsInChildren<Item>();
if (listOfItems != null)
foreach (Item i in listOfItems)
totalItemCount += 1;
}
if (zonePool)
{
listOfZone = zonePool.GetScriptsInChildren<ScoringZone>();
if (listOfZone != null)
foreach (ScoringZone sz in listOfZone)
sz.gameManger = Owner.GetScript<GameManager>();
}
}
protected override void update()
{
if (timer > 0 && currGameState == GameState.START)
{
timer -= Time.DeltaTimeF;
if (totalItemCount <= 0)
{
currGameState = GameState.WIN;
}
}
else
currGameState = GameState.LOSE;
}
}

View File

@ -0,0 +1,3 @@
Name: SC_GameManager
ID: 161629605
Type: 9

View File

@ -0,0 +1,52 @@
using SHADE;
using System;
public class Item : Script
{
public enum ItemCategory
{
LIGHT,
MEDIUM,
HEAVY
}
public int Score = 10;
public ItemCategory currCategory;
private RigidBody rb;
private Collider collider;
private bool once = false;
protected override void awake()
{
collider = GetComponent<Collider>();
if (collider)
{
collider.GetCollisionShape(0).Density = 1;
}
rb = GetComponent<RigidBody>();
if (rb)
{
rb.FreezeRotationX = false;
rb.FreezeRotationY = false;
rb.FreezeRotationZ = false;
}
}
protected override void onCollisionEnter(CollisionInfo info)
{
if (once)
{
if(currCategory == ItemCategory.LIGHT)
Audio.PlayBGMOnce2D("event:/Props/impact_elastic");
else if (currCategory == ItemCategory.MEDIUM || currCategory == ItemCategory.HEAVY)
Audio.PlayBGMOnce2D("event:/Props/impact_hard");
once = false;
}
}
protected override void onCollisionExit(CollisionInfo info)
{
once = true;
}
}

View File

@ -0,0 +1,3 @@
Name: SC_Item
ID: 153136539
Type: 9

View File

@ -0,0 +1,22 @@
using SHADE;
using System;
public class ScoringZone : Script
{
public GameManager gameManger { get; set; }
protected override void awake()
{
}
protected override void onTriggerEnter(CollisionInfo info)
{
if (gameManger && info.GameObject.GetScript<Item>())
{
Audio.PlayBGMOnce2D("event:/Music/stingers/item_scored");
gameManger.Score += info.GameObject.GetScript<Item>().Score;
gameManger.totalItemCount -= 1;
info.GameObject.SetActive(false);
}
}
}

View File

@ -0,0 +1,3 @@
Name: SC_ScoringZone
ID: 153171688
Type: 9

View File

@ -0,0 +1,3 @@
Name: PhysicsTest
ID: 159771801
Type: 9

View File

@ -2,8 +2,6 @@
public class PrintWhenActive : Script public class PrintWhenActive : Script
{ {
public PrintWhenActive(GameObject gameObj) : base(gameObj) { }
protected override void update() protected override void update()
{ {
Debug.Log("Active!"); Debug.Log("Active!");

View File

@ -0,0 +1,3 @@
Name: PrintWhenActive
ID: 162536221
Type: 9

View File

@ -1,5 +1,6 @@
using SHADE; using SHADE;
using System; using System;
using System.Collections.Generic;
public class RaccoonShowcase : Script public class RaccoonShowcase : Script
{ {
@ -17,8 +18,14 @@ public class RaccoonShowcase : Script
private double rotation = 0.0; private double rotation = 0.0;
private Vector3 scale = Vector3.Zero; private Vector3 scale = Vector3.Zero;
private double originalScale = 1.0f; private double originalScale = 1.0f;
public RaccoonShowcase(GameObject gameObj) : base(gameObj) {} [Tooltip("Sample list of Vector3s.")]
public List<Vector3> vecList = new List<Vector3>(new Vector3[] { new Vector3(1, 2, 3), new Vector3(4, 5, 6) });
[Range(-5, 5)]
public List<int> intList = new List<int>(new int[] { 2, 8, 2, 6, 8, 0, 1 });
public List<Light.Type> enumList = new List<Light.Type>(new Light.Type[] { Light.Type.Point, Light.Type.Directional, Light.Type.Ambient });
public FontAsset fontAsset;
public MeshAsset mesh;
public MaterialAsset matAsset;
protected override void awake() protected override void awake()
{ {
Transform = GetComponent<Transform>(); Transform = GetComponent<Transform>();
@ -27,6 +34,11 @@ public class RaccoonShowcase : Script
Debug.LogError("Transform is NULL!"); Debug.LogError("Transform is NULL!");
} }
foreach (var child in Owner)
{
Debug.Log(child.Name);
}
originalScale = Transform.LocalScale.z; originalScale = Transform.LocalScale.z;
} }
protected override void update() protected override void update()

View File

@ -0,0 +1,3 @@
Name: RaccoonShowcase
ID: 159969631
Type: 9

View File

@ -14,8 +14,6 @@ public class RaccoonSpin : Script
[SerializeField] [SerializeField]
private CallbackEvent<int, double, Vector3> testEvent3 = new CallbackEvent<int, double, Vector3>(); private CallbackEvent<int, double, Vector3> testEvent3 = new CallbackEvent<int, double, Vector3>();
private Transform Transform; private Transform Transform;
public RaccoonSpin(GameObject gameObj) : base(gameObj) { }
protected override void awake() protected override void awake()
{ {

View File

@ -0,0 +1,3 @@
Name: RaccoonSpin
ID: 157367824
Type: 9

View File

@ -0,0 +1,13 @@
using System;
using SHADE;
public class SC_MainMenu : Script
{
protected override void awake()
{
}
protected override void update()
{
}
}

View File

@ -0,0 +1,3 @@
Name: SC_MainMenu
ID: 158552402
Type: 9

View File

@ -0,0 +1,74 @@
using SHADE;
using System;
public class SoundsBoard : Script
{
protected override void awake()
{
/*
* event:/UI/failure
event:/UI/mouse_down_element
event:/UI/mouse_down_empty
event:/UI/mouse_enter_element
event:/UI/mouse_exit_element
event:/UI/success
event:/Raccoon/raccoon_footsteps
event:/Raccoon/raccoon_throw
event:/Props/impact_hard
event:/Props/impact_elastic
event:/Music/player_undetected
event:/Music/player_detected
event:/Music/stingers/player_detected
event:/Music/stingers/item_scored
event:/Homeowner/homeowner_humming
event:/Homeowner/homeowner_footsteps
event:/Homeowner/homeowner_detect_raccoon
*/
}
protected override void update()
{
if (Input.GetKeyDown(Input.KeyCode.Q))
Audio.PlayBGMOnce2D("event:/UI/mouse_down_element");
if (Input.GetKeyDown(Input.KeyCode.W))
Audio.PlayBGMOnce2D("event:/UI/mouse_down_empty");
if (Input.GetKeyDown(Input.KeyCode.E))
Audio.PlayBGMOnce2D("event:/UI/mouse_enter_element");
if (Input.GetKeyDown(Input.KeyCode.R))
Audio.PlayBGMOnce2D("event:/UI/mouse_exit_element");
if (Input.GetKeyDown(Input.KeyCode.T))
Audio.PlayBGMOnce2D("event:/UI/success");
if (Input.GetKeyDown(Input.KeyCode.Y))
Audio.PlayBGMOnce2D("event:/Raccoon/raccoon_throw");
if (Input.GetKeyDown(Input.KeyCode.U))
Audio.PlayBGMOnce2D("event:/Props/impact_hard");
if (Input.GetKeyDown(Input.KeyCode.I))
Audio.PlayBGMOnce2D("event:/Music/player_undetected");
if (Input.GetKeyDown(Input.KeyCode.O))
Audio.PlayBGMOnce2D("event:/Music/player_detected");
if (Input.GetKeyDown(Input.KeyCode.P))
Audio.PlayBGMOnce2D("event:/Music/stingers/player_detected");
if (Input.GetKeyDown(Input.KeyCode.A))
Audio.PlayBGMOnce2D("event:/Music/stingers/item_scored");
if (Input.GetKeyDown(Input.KeyCode.S))
Audio.PlayBGMOnce2D("event:/Homeowner/homeowner_humming");
if (Input.GetKeyDown(Input.KeyCode.D))
Audio.PlayBGMOnce2D("event:/Homeowner/homeowner_footsteps");
if (Input.GetKeyDown(Input.KeyCode.F))
Audio.PlayBGMOnce2D("event:/Homeowner/homeowner_detect_raccoon");
if (Input.GetKeyDown(Input.KeyCode.G))
Audio.PlayBGMOnce2D("event:/Music/player_undetected");
if (Input.GetKeyDown(Input.KeyCode.H))
Audio.PlayBGMOnce2D("event:/Raccoon/raccoon_footsteps");
if (Input.GetKeyDown(Input.KeyCode.J))
Audio.PlayBGMOnce2D("event:/Props/impact_elastic");
}
}

View File

@ -0,0 +1,3 @@
Name: SC_SoundsBoard
ID: 156397807
Type: 9

View File

@ -0,0 +1,68 @@
using SHADE;
using System;
public abstract class BaseState
{
protected string stateName = "Base State";
protected StateMachine machine;
protected string animationName = "";
public BaseState(StateMachine stateMachine, string animName = "")
{
machine = stateMachine;
animationName = animName;
}
public virtual void OnEnter()
{
}
public abstract void update();
public abstract void fixedUpdate();
public virtual void OnExit()
{
}
public string GetStateName()
{
return stateName;
}
public string GetAnimName()
{
return animationName;
}
public virtual float GetAnimPercent()
{
return 1.0f;
}
public virtual void onCollisionEnter(CollisionInfo info)
{
}
public virtual void onCollisionStay(CollisionInfo info)
{
}
public virtual void onCollisionExit(CollisionInfo info)
{
}
public virtual void onTriggerEnter(CollisionInfo info)
{
}
public virtual void onTriggerStay(CollisionInfo info)
{
}
public virtual void onTriggerExit(CollisionInfo info)
{
}
}

View File

@ -0,0 +1,3 @@
Name: UT_BaseSate
ID: 154709755
Type: 9

Some files were not shown because too many files have changed in this diff Show More