Compare commits
No commits in common. "main" and "SP3-10-input-management" have entirely different histories.
main
...
SP3-10-inp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,8 +0,0 @@
|
|||
- VertexShader: 46580970
|
||||
FragmentShader: 35983630
|
||||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.textureIndex: 64816540
|
||||
data.alpha: 1
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
|
@ -1,3 +0,0 @@
|
|||
Name: UIMat_SliderBG
|
||||
ID: 117587364
|
||||
Type: 7
|
|
@ -1,11 +0,0 @@
|
|||
- VertexShader: 46580970
|
||||
FragmentShader: 43211183
|
||||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.textureIndex: 50370514
|
||||
data.alpha: 1
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
||||
data.sliderThreshold: 1
|
||||
data.sliderStartColor: {x: 0.36500001, y: 0.783999979, z: 0.878000021, w: 1}
|
||||
data.sliderBarColor: {x: 1, y: 1, z: 1, w: 1}
|
|
@ -1,3 +0,0 @@
|
|||
Name: UIMat_Slider_BGM
|
||||
ID: 129354037
|
||||
Type: 7
|
|
@ -1,11 +0,0 @@
|
|||
- VertexShader: 46580970
|
||||
FragmentShader: 43211183
|
||||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.textureIndex: 50370514
|
||||
data.alpha: 1
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
||||
data.sliderThreshold: 1
|
||||
data.sliderStartColor: {x: 0.624000013, y: 0.211999997, z: 0.949000001, w: 1}
|
||||
data.sliderBarColor: {x: 1, y: 1, z: 1, w: 1}
|
|
@ -1,3 +0,0 @@
|
|||
Name: UIMat_Slider_FOV
|
||||
ID: 117651669
|
||||
Type: 7
|
|
@ -1,11 +0,0 @@
|
|||
- VertexShader: 46580970
|
||||
FragmentShader: 43211183
|
||||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.textureIndex: 50370514
|
||||
data.alpha: 1
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
||||
data.sliderThreshold: 1
|
||||
data.sliderStartColor: {x: 0.949000001, y: 0.689999998, z: 0.211999997, w: 1}
|
||||
data.sliderBarColor: {x: 1, y: 1, z: 1, w: 1}
|
|
@ -1,3 +0,0 @@
|
|||
Name: UIMat_Slider_SFX
|
||||
ID: 122820018
|
||||
Type: 7
|
|
@ -3,9 +3,7 @@
|
|||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.textureIndex: 50370514
|
||||
data.textureIndex: 51995224
|
||||
data.alpha: 1
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
||||
data.sliderThreshold: 1
|
||||
data.sliderStartColor: {x: 0.254901886, y: 0.321500003, z: 0.909799993, w: 1}
|
||||
data.sliderBarColor: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.sliderThreshold: 1
|
|
@ -1,8 +0,0 @@
|
|||
- VertexShader: 46580970
|
||||
FragmentShader: 40208610
|
||||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.textureIndex: 50770098
|
||||
data.alpha: 1
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
|
@ -1,3 +0,0 @@
|
|||
Name: UIMat_Transistion
|
||||
ID: 132131066
|
||||
Type: 7
|
|
@ -1,8 +0,0 @@
|
|||
- VertexShader: 46580970
|
||||
FragmentShader: 35983630
|
||||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 1, y: 1, z: 1, w: 1}
|
||||
data.textureIndex: 55490391
|
||||
data.alpha: 1
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
|
@ -1,3 +0,0 @@
|
|||
Name: UI_Result
|
||||
ID: 130179375
|
||||
Type: 7
|
Binary file not shown.
|
@ -1,3 +1,3 @@
|
|||
Name: Level3_NavData
|
||||
ID: 252819653
|
||||
ID: 263362242
|
||||
Type: 15
|
||||
|
|
|
@ -1,174 +0,0 @@
|
|||
- NavData: 0
|
||||
- EID: 0
|
||||
Name: Camera
|
||||
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
|
||||
Near: 0.00999999978
|
||||
Far: 10000
|
||||
Perspective: true
|
||||
FOV: 90
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 46
|
||||
Name: Credits Canvas
|
||||
IsActive: true
|
||||
NumberOfChildren: 3
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 47
|
||||
Name: Scrolling Credits
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: -3800, z: 1.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 8026, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 120332672
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 46
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.ScrollingCredits
|
||||
Enabled: true
|
||||
endY: 4300
|
||||
duration: 27
|
||||
levelTransition: 619
|
||||
- Type: SHADE_Scripting.UI.TransitToMainMenu
|
||||
Enabled: true
|
||||
timeToTransit: 27
|
||||
sceneToChange: 97158628
|
||||
- EID: 49
|
||||
Name: Credits Title Text
|
||||
IsActive: false
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -150, y: 400, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 100, y: 100, z: 1}
|
||||
IsActive: false
|
||||
Text Renderer Component:
|
||||
Text: Credits
|
||||
Font: 174412429
|
||||
Color: {x: 0, y: 0, z: 0, w: 1}
|
||||
Text Size: {x: 1, y: 1, z: 1}
|
||||
IsActive: false
|
||||
UI Component:
|
||||
Canvas ID: 46
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: false
|
||||
Scripts: ~
|
||||
- EID: 55
|
||||
Name: BackGround
|
||||
IsActive: false
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 1.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 1080, z: 1}
|
||||
IsActive: false
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 121834459
|
||||
IsActive: false
|
||||
UI Component:
|
||||
Canvas ID: 46
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: false
|
||||
Scripts: ~
|
||||
- EID: 54
|
||||
Name: TweenManager
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components: ~
|
||||
Scripts:
|
||||
- Type: TweenManager
|
||||
Enabled: true
|
||||
- EID: 619
|
||||
Name: LevelTransistionCanvas
|
||||
IsActive: true
|
||||
NumberOfChildren: 2
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: LevelTransistion
|
||||
Enabled: true
|
||||
logo: 618
|
||||
bg: 617
|
||||
duration: 0.5
|
||||
bgEndPositionX: 3000
|
||||
logoEndPositionX: 3000
|
||||
rotAndScale: false
|
||||
rotationAmt: 360
|
||||
scaleAmt: 631
|
||||
- EID: 618
|
||||
Name: LevelTransistionLogo
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 631, y: 631, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 126117259
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 619
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 617
|
||||
Name: LevelTransistionBG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.200000003}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 4000, y: 4000, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 132131066
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 619
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
|
@ -1,3 +0,0 @@
|
|||
Name: CreditsScene
|
||||
ID: 97376761
|
||||
Type: 5
|
|
@ -1,4 +1,3 @@
|
|||
- NavData: 0
|
||||
- EID: 1
|
||||
Name: Canvas4
|
||||
IsActive: true
|
||||
|
@ -153,7 +152,7 @@
|
|||
Scripts:
|
||||
- Type: CutsceneEnd
|
||||
Enabled: true
|
||||
nextScene: 97376761
|
||||
nextScene: 92009475
|
||||
duration: 1
|
||||
skipDuration: 0.100000001
|
||||
cutscene4Points: 4
|
||||
|
@ -162,7 +161,6 @@
|
|||
cutscene5Pics: 15
|
||||
canvas4: 1
|
||||
canvas5: 14
|
||||
levelTransition: 619
|
||||
- EID: 4
|
||||
Name: CutScene4Points
|
||||
IsActive: true
|
||||
|
@ -290,7 +288,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 250, y: -500, z: 0.300000012}
|
||||
Translate: {x: 250, y: -500, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 50, y: 50, z: 50}
|
||||
IsActive: true
|
||||
|
@ -333,73 +331,4 @@
|
|||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 619
|
||||
Name: LevelTransistionCanvas
|
||||
IsActive: true
|
||||
NumberOfChildren: 2
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: LevelTransistion
|
||||
Enabled: true
|
||||
logo: 618
|
||||
bg: 617
|
||||
duration: 0.5
|
||||
bgEndPositionX: 3000
|
||||
logoEndPositionX: 3000
|
||||
rotAndScale: false
|
||||
rotationAmt: 360
|
||||
scaleAmt: 631
|
||||
- EID: 618
|
||||
Name: LevelTransistionLogo
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 631, y: 631, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 126117259
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 619
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 617
|
||||
Name: LevelTransistionBG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.200000003}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 4000, y: 4000, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 132131066
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 619
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 616
|
||||
Name: TweenManager
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components: ~
|
||||
Scripts:
|
||||
- Type: TweenManager
|
||||
Enabled: true
|
||||
Scripts: ~
|
|
@ -1,4 +1,3 @@
|
|||
- NavData: 0
|
||||
- EID: 1
|
||||
Name: Canvas1
|
||||
IsActive: true
|
||||
|
@ -165,7 +164,6 @@
|
|||
canvas1: 1
|
||||
canvas2: 13
|
||||
canvas3: 24
|
||||
levelTransition: 619
|
||||
- EID: 4
|
||||
Name: CutScene1Points
|
||||
IsActive: true
|
||||
|
@ -179,7 +177,7 @@
|
|||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -550, y: 0, z: 0.5}
|
||||
Rotate: {x: 500.5, y: -274.5, z: 0.600000024}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
|
@ -396,7 +394,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -1375, y: 250, z: 0.899999976}
|
||||
Translate: {x: -1375, y: 250, z: 0.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 982, y: 527, z: 1}
|
||||
IsActive: true
|
||||
|
@ -416,7 +414,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 200, y: 1200, z: 0.800000012}
|
||||
Translate: {x: 200, y: 1200, z: 0.400000006}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 625, y: 579, z: 1}
|
||||
IsActive: true
|
||||
|
@ -436,7 +434,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 1700, y: 200, z: 0.699999988}
|
||||
Translate: {x: 1700, y: 200, z: 0.300000012}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 529, y: 670, z: 1}
|
||||
IsActive: true
|
||||
|
@ -456,7 +454,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -1600, y: -200, z: 0.899999976}
|
||||
Translate: {x: -1600, y: -200, z: 0.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1299, y: 575, z: 1}
|
||||
IsActive: true
|
||||
|
@ -476,7 +474,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 500, y: -1275, z: 0.899999976}
|
||||
Translate: {x: 500, y: -1275, z: 0.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 866, y: 483, z: 1}
|
||||
IsActive: true
|
||||
|
@ -496,7 +494,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.99000001}
|
||||
Translate: {x: 0, y: 0, z: 0.699999988}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 1080, z: 1}
|
||||
IsActive: true
|
||||
|
@ -516,7 +514,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 250, y: -500, z: 0.400000006}
|
||||
Translate: {x: 250, y: -500, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 50, y: 50, z: 50}
|
||||
IsActive: true
|
||||
|
@ -544,7 +542,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -375, y: 250, z: 0.899999976}
|
||||
Translate: {x: -375, y: 250, z: 0.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
|
@ -555,7 +553,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 200, y: 200, z: 0.800000012}
|
||||
Translate: {x: 200, y: 200, z: 0.400000006}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
|
@ -566,7 +564,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 700, y: 200, z: 0.699999988}
|
||||
Translate: {x: 700, y: 200, z: 0.300000012}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
|
@ -577,7 +575,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -225, y: -200, z: 0.600000024}
|
||||
Translate: {x: -225, y: -200, z: 0.200000003}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
|
@ -588,77 +586,8 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 500, y: -275, z: 0.5}
|
||||
Translate: {x: 500, y: -275, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 619
|
||||
Name: LevelTransistionCanvas
|
||||
IsActive: true
|
||||
NumberOfChildren: 2
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: LevelTransistion
|
||||
Enabled: true
|
||||
logo: 618
|
||||
bg: 617
|
||||
duration: 0.5
|
||||
bgEndPositionX: 3000
|
||||
logoEndPositionX: 3000
|
||||
rotAndScale: false
|
||||
rotationAmt: 360
|
||||
scaleAmt: 631
|
||||
- EID: 618
|
||||
Name: LevelTransistionLogo
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 631, y: 631, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 126117259
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 619
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 617
|
||||
Name: LevelTransistionBG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.200000003}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 4000, y: 4000, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 132131066
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 619
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 616
|
||||
Name: TweenManager
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components: ~
|
||||
Scripts:
|
||||
- Type: TweenManager
|
||||
Enabled: true
|
||||
Scripts: ~
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -38,7 +38,7 @@
|
|||
Transform Component:
|
||||
Translate: {x: 0, y: 100, z: 0.300000012}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 631.577454, y: 631.577454, z: 1.24826539}
|
||||
Scale: {x: 600, y: 600, z: 1.18585491}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
|
@ -55,7 +55,6 @@
|
|||
minScale: 1
|
||||
maxScale: 1.20000005
|
||||
duration: 1.5
|
||||
isActive: true
|
||||
- EID: 54
|
||||
Name: Main Menu Button Group
|
||||
IsActive: true
|
||||
|
@ -259,7 +258,7 @@
|
|||
Transform Component:
|
||||
Translate: {x: 450, y: 0, z: 0.400000006}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 389.627228, y: 97.4068069, z: 0.974068105}
|
||||
Scale: {x: 400, y: 100, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
|
@ -750,16 +749,16 @@
|
|||
- EID: 29
|
||||
Name: Master Volume Slider
|
||||
IsActive: true
|
||||
NumberOfChildren: 1
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1004, y: 46, z: 1}
|
||||
Scale: {x: 1000, y: 75, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 127128823
|
||||
Material: 128676209
|
||||
IsActive: true
|
||||
Slider Component:
|
||||
Slider Value: 1
|
||||
|
@ -771,44 +770,20 @@
|
|||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SliderFX
|
||||
Enabled: true
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
- EID: 437
|
||||
Name: Slider BG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1.01992035, y: 1.39130437, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 117587364
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 19
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 30
|
||||
Name: SFX Volume Slider
|
||||
IsActive: true
|
||||
NumberOfChildren: 1
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: -100, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1004, y: 46, z: 1}
|
||||
Scale: {x: 1000, y: 75, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 122820018
|
||||
Material: 128676209
|
||||
IsActive: true
|
||||
Slider Component:
|
||||
Slider Value: 1
|
||||
|
@ -820,44 +795,20 @@
|
|||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SliderFX
|
||||
Enabled: true
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
- EID: 436
|
||||
Name: Slider BG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1.01992035, y: 1.39130437, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 117587364
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 19
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 31
|
||||
Name: BGM Volume Slider
|
||||
IsActive: true
|
||||
NumberOfChildren: 1
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: -200, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1004, y: 46, z: 1}
|
||||
Scale: {x: 1000, y: 75, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 129354037
|
||||
Material: 128676209
|
||||
IsActive: true
|
||||
Slider Component:
|
||||
Slider Value: 1
|
||||
|
@ -869,30 +820,6 @@
|
|||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SliderFX
|
||||
Enabled: true
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
- EID: 435
|
||||
Name: Slider BG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1.01992035, y: 1.39130437, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 117587364
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 19
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 32
|
||||
Name: Camera Title Text
|
||||
|
@ -1017,19 +944,19 @@
|
|||
- EID: 37
|
||||
Name: FOV Slider
|
||||
IsActive: true
|
||||
NumberOfChildren: 1
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1004, y: 46, z: 1}
|
||||
Scale: {x: 1000, y: 75, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 117651669
|
||||
Material: 128676209
|
||||
IsActive: true
|
||||
Slider Component:
|
||||
Slider Value: 0.889483869
|
||||
Slider Value: 1
|
||||
Min Value: 30
|
||||
Max Value: 120
|
||||
IsActive: true
|
||||
|
@ -1038,30 +965,6 @@
|
|||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SliderFX
|
||||
Enabled: true
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
- EID: 434
|
||||
Name: Slider BG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1.01992035, y: 1.39130437, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 117587364
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 19
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 448
|
||||
Name: Invert X Toggle Button
|
||||
|
@ -1092,14 +995,6 @@
|
|||
Enabled: true
|
||||
inverseX: true
|
||||
inverseY: false
|
||||
- Type: SHADE_Scripting.UI.ButtonFX
|
||||
Enabled: true
|
||||
onHoverEnterSound: event:/UI/botton_hover
|
||||
onHoverExitSound: Empty
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
hoverScale: 1.25
|
||||
clickScale: 0.899999976
|
||||
- EID: 445
|
||||
Name: Invert Y Toggle Button
|
||||
IsActive: true
|
||||
|
@ -1129,14 +1024,6 @@
|
|||
Enabled: true
|
||||
inverseX: false
|
||||
inverseY: true
|
||||
- Type: SHADE_Scripting.UI.ButtonFX
|
||||
Enabled: true
|
||||
onHoverEnterSound: event:/UI/botton_hover
|
||||
onHoverExitSound: Empty
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
hoverScale: 1.25
|
||||
clickScale: 0.899999976
|
||||
- EID: 39
|
||||
Name: Audio Slider Text Group
|
||||
IsActive: true
|
||||
|
@ -1255,7 +1142,7 @@
|
|||
Scale: {x: 75, y: 75, z: 1}
|
||||
IsActive: true
|
||||
Text Renderer Component:
|
||||
Text: 60
|
||||
Text: 100
|
||||
Font: 174412429
|
||||
Color: {x: 0, y: 0, z: 0, w: 1}
|
||||
Text Size: {x: 1, y: 1, z: 1}
|
||||
|
@ -1441,7 +1328,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -800, y: 450, z: 0.300000012}
|
||||
Translate: {x: -800, y: 450, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 273, y: 100, z: 1}
|
||||
IsActive: true
|
||||
|
@ -1477,7 +1364,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -250, y: 400, z: 0.300000012}
|
||||
Translate: {x: -250, y: 400, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 100, y: 100, z: 1}
|
||||
IsActive: true
|
||||
|
@ -1537,7 +1424,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -600, y: 0, z: 0.300000012}
|
||||
Translate: {x: -600, y: 0, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 345, y: 800, z: 1}
|
||||
IsActive: true
|
||||
|
@ -1559,22 +1446,13 @@
|
|||
- Type: ChangeSceneButton
|
||||
Enabled: true
|
||||
sceneID: 91947920
|
||||
levelTransistion: 433
|
||||
- Type: SHADE_Scripting.UI.ButtonFX
|
||||
Enabled: true
|
||||
onHoverEnterSound: event:/UI/botton_hover
|
||||
onHoverExitSound: Empty
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
hoverScale: 1.10000002
|
||||
clickScale: 0.899999976
|
||||
- EID: 439
|
||||
Name: Level 2 Button
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.300000012}
|
||||
Translate: {x: 0, y: 0, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 345, y: 800, z: 1}
|
||||
IsActive: true
|
||||
|
@ -1596,22 +1474,13 @@
|
|||
- Type: ChangeSceneButton
|
||||
Enabled: true
|
||||
sceneID: 86098106
|
||||
levelTransistion: 433
|
||||
- Type: SHADE_Scripting.UI.ButtonFX
|
||||
Enabled: true
|
||||
onHoverEnterSound: event:/UI/botton_hover
|
||||
onHoverExitSound: Empty
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
hoverScale: 1.10000002
|
||||
clickScale: 0.899999976
|
||||
- EID: 438
|
||||
Name: Level 3 Button
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 600, y: 0, z: 0.300000012}
|
||||
Translate: {x: 600, y: 0, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 345, y: 800, z: 1}
|
||||
IsActive: true
|
||||
|
@ -1633,15 +1502,6 @@
|
|||
- Type: ChangeSceneButton
|
||||
Enabled: true
|
||||
sceneID: 88928066
|
||||
levelTransistion: 433
|
||||
- Type: SHADE_Scripting.UI.ButtonFX
|
||||
Enabled: true
|
||||
onHoverEnterSound: event:/UI/botton_hover
|
||||
onHoverExitSound: Empty
|
||||
onClickSound: event:/UI/button_success
|
||||
onReleaseSound: event:/UI/button_fail
|
||||
hoverScale: 1.10000002
|
||||
clickScale: 0.899999976
|
||||
- EID: 450
|
||||
Name: TransitionCanvas
|
||||
IsActive: true
|
||||
|
@ -1675,67 +1535,6 @@
|
|||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SceneFadeInOut
|
||||
Enabled: true
|
||||
alphaValue: 0
|
||||
alphaValue: 1
|
||||
fadeInTime: 0.5
|
||||
fadeOutTime: 0.5
|
||||
- EID: 433
|
||||
Name: LevelTransistionCanvas
|
||||
IsActive: false
|
||||
NumberOfChildren: 2
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: false
|
||||
Scripts:
|
||||
- Type: LevelTransistion
|
||||
Enabled: true
|
||||
logo: 431
|
||||
bg: 432
|
||||
duration: 0.800000012
|
||||
bgEndPositionX: 0
|
||||
logoEndPositionX: 0
|
||||
rotAndScale: true
|
||||
rotationAmt: 360
|
||||
scaleAmt: 631
|
||||
- EID: 431
|
||||
Name: LevelTransistionLogo
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 0, y: 0, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 126117259
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 433
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 432
|
||||
Name: LevelTransistionBG
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: -2500, y: 0, z: 0.200000003}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 4000, y: 4000, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 132131066
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 433
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
fadeOutTime: 0.5
|
|
@ -1,4 +1,3 @@
|
|||
- NavData: 0
|
||||
- EID: 0
|
||||
Name: Default
|
||||
IsActive: true
|
||||
|
@ -171,13 +170,8 @@
|
|||
Angular Ranges And Offset: {x: 6.19999981, y: 1.10000002, z: 0, w: 0.100000001}
|
||||
Rotation Speed: 0.0309999995
|
||||
Rotation Decay: 0.0199999996
|
||||
Texture Asset ID: 0
|
||||
Custom Vertex Shader Asset ID: 44202416
|
||||
Custom Fragment Shader Asset ID: 42315398
|
||||
Texture Asset ID: 63456868
|
||||
Custom Update Shader Asset ID: 0
|
||||
Color Tint: {x: 0.46696043, y: 1, z: 0, w: 1}
|
||||
Color Tint Range: {x: 1, y: 0, z: 0, w: 0}
|
||||
Color Decay: {x: -1, y: -1, z: -1, w: 0}
|
||||
Acceleration: {x: 0, y: 0, z: 0}
|
||||
Color Tint: {x: 1, y: 0, z: 0, w: 1}
|
||||
IsActive: true
|
||||
Scripts: ~
|
|
@ -1,176 +1,150 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SHADE;
|
||||
using SHADE_Scripting.Audio;
|
||||
using SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States;
|
||||
|
||||
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
||||
{
|
||||
public class HomeOwnerAI : Script
|
||||
{
|
||||
public float idleDuration = 1.0f;
|
||||
public float caughtDuration = 2.0f;
|
||||
public float timeoutDuration = 2.0f;
|
||||
public GameObject patrolPointParent;
|
||||
|
||||
public float patrolSpeed = 2.0f;
|
||||
public float chaseSpeed = 3.0f;
|
||||
|
||||
public float alertCooldown = 0.0f;
|
||||
|
||||
public GameObject player;
|
||||
public GameObject attackHitbox;
|
||||
|
||||
public AnimationClipAsset walkingAnim;
|
||||
public AnimationClipAsset idleAnim;
|
||||
public AnimationClipAsset alertAnim;
|
||||
public AnimationClipAsset alertRunAnim;
|
||||
public AnimationClipAsset alertIdleAnim;
|
||||
public AnimationClipAsset timeoutAnim;
|
||||
public AnimationClipAsset atkWindupAnim;
|
||||
public AnimationClipAsset atkHoldAnim;
|
||||
public AnimationClipAsset atkSeqAnim;
|
||||
|
||||
|
||||
|
||||
|
||||
private Vector3 startPos;
|
||||
public bool atk { get; set; }
|
||||
|
||||
[NonSerialized]
|
||||
public IEnumerable<Transform> patrolPointPool;
|
||||
|
||||
private List<Transform> pppList;
|
||||
|
||||
private Transform transform;
|
||||
|
||||
[NonSerialized]
|
||||
public HomeOwnerAttackHitbox hitboxScript;
|
||||
|
||||
public void Reset()
|
||||
public class HomeOwnerAI:Script
|
||||
{
|
||||
StateMachine machine = GetScript<StateMachine>();
|
||||
if (transform && machine)
|
||||
{
|
||||
transform.GlobalPosition = startPos;
|
||||
machine.SetState(typeof(IdleState));
|
||||
}
|
||||
}
|
||||
public float idleDuration = 1.0f;
|
||||
public float timeoutDuration = 2.0f;
|
||||
public GameObject patrolPointParent;
|
||||
|
||||
public float patrolSpeed = 2.0f;
|
||||
public float chaseSpeed = 3.0f;
|
||||
|
||||
public float alertCooldown = 0.0f;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
StateMachine machine = GetScript<StateMachine>();
|
||||
if (machine)
|
||||
{
|
||||
Dictionary<Type, BaseState> dictionary = new Dictionary<Type, BaseState>();
|
||||
dictionary.Add(typeof(IdleState), new IdleState(machine));
|
||||
dictionary.Add(typeof(PatrolState), new PatrolState(machine));
|
||||
dictionary.Add(typeof(TimeoutState), new TimeoutState(machine));
|
||||
dictionary.Add(typeof(ChaseState), new ChaseState(machine));
|
||||
dictionary.Add(typeof(AlertState), new AlertState(machine));
|
||||
dictionary.Add(typeof(AttackState), new AttackState(machine));
|
||||
dictionary.Add(typeof(CaughtRaccoonState), new CaughtRaccoonState(machine));
|
||||
public GameObject player;
|
||||
public GameObject attackHitbox;
|
||||
|
||||
machine.InitStateMachine(dictionary);
|
||||
}
|
||||
public AnimationClipAsset walkingAnim;
|
||||
public AnimationClipAsset idleAnim;
|
||||
public AnimationClipAsset alertAnim;
|
||||
public AnimationClipAsset alertRunAnim;
|
||||
public AnimationClipAsset alertIdleAnim;
|
||||
public AnimationClipAsset timeoutAnim;
|
||||
public AnimationClipAsset atkWindupAnim;
|
||||
public AnimationClipAsset atkHoldAnim;
|
||||
public AnimationClipAsset atkSeqAnim;
|
||||
|
||||
AudioHandler.audioClipHandlers["HO_footsteps"] = SHADE.Audio.CreateAudioClip("event:/Homeowner/homeowner_footsteps");
|
||||
SHADE.Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["HO_footsteps"], GameObject.EntityId);
|
||||
private Vector3 startPos;
|
||||
|
||||
AudioHandler.audioClipHandlers["HO_bark"] = SHADE.Audio.CreateAudioClip("event:/Homeowner/homeowner_bark");
|
||||
SHADE.Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["HO_bark"], GameObject.EntityId);
|
||||
[NonSerialized]
|
||||
public IEnumerable<Transform> patrolPointPool;
|
||||
|
||||
AudioHandler.audioClipHandlers["HO_humming"] = SHADE.Audio.CreateAudioClip("event:/Homeowner/homeowner_humming");
|
||||
SHADE.Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["HO_humming"], GameObject.EntityId);
|
||||
|
||||
patrolPointPool = patrolPointParent.GetComponentsInChildren<Transform>();
|
||||
pppList = patrolPointPool.ToList<Transform>();
|
||||
transform = GetComponent<Transform>();
|
||||
|
||||
atk = false;
|
||||
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
//attackHitbox.SetActive(false);
|
||||
if (pppList != null)
|
||||
startPos = pppList[0].LocalPosition;
|
||||
|
||||
if (attackHitbox)
|
||||
hitboxScript = attackHitbox.GetScript<HomeOwnerAttackHitbox>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if (alertCooldown > 0.0f)
|
||||
{
|
||||
alertCooldown -= Time.DeltaTimeF;
|
||||
}
|
||||
else
|
||||
{
|
||||
alertCooldown = 0.0f;
|
||||
}
|
||||
AICheat();
|
||||
}
|
||||
|
||||
public bool ShouldTransitAlert()
|
||||
{
|
||||
AILineOfSight los = GetScript<AILineOfSight>();
|
||||
if (los)
|
||||
{
|
||||
if (los.withinSight && alertCooldown <= 0.0f)
|
||||
public void Reset()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void RotateToPlayer()
|
||||
{
|
||||
|
||||
//Transform playerTransform = player.GetComponent<Transform>();
|
||||
|
||||
////Rotate to face player.
|
||||
//Transform aiTransform = GetComponent<Transform>();
|
||||
//if(playerTransform && aiTransform)
|
||||
//{
|
||||
// Vector3 direction = playerTransform.GlobalPosition - aiTransform.GlobalPosition;
|
||||
// Quaternion currentRotation = aiTransform.LocalRotation;
|
||||
// Quaternion targetRotation = Quaternion.Euler(0.0f, MathF.Atan2(direction.x, direction.z), 0.0f);
|
||||
// aiTransform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, 5.0f * (float)Time.FixedDeltaTime);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
private void AICheat()
|
||||
{
|
||||
StateMachine machine = GetScript<StateMachine>();
|
||||
AILineOfSight los = GetScript<AILineOfSight>();
|
||||
if (machine && los)
|
||||
{
|
||||
if (Input.GetKeyDown(Input.KeyCode.K))
|
||||
{
|
||||
los.range = 5.0f;
|
||||
machine.SetState(typeof(AlertState));
|
||||
}
|
||||
if (Input.GetKeyDown(Input.KeyCode.L))
|
||||
{
|
||||
los.range = 0.0f;
|
||||
machine.SetState(typeof(IdleState));
|
||||
Transform transform = GetComponent<Transform>();
|
||||
StateMachine machine = GetScript<StateMachine>();
|
||||
if (transform && machine)
|
||||
{
|
||||
transform.GlobalPosition = startPos;
|
||||
machine.SetState(typeof(IdleState));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
StateMachine machine = GetScript<StateMachine>();
|
||||
if(machine)
|
||||
{
|
||||
Dictionary<Type, BaseState> dictionary = new Dictionary<Type, BaseState>();
|
||||
dictionary.Add(typeof(IdleState), new IdleState(machine));
|
||||
dictionary.Add(typeof(PatrolState), new PatrolState(machine));
|
||||
dictionary.Add(typeof(TimeoutState), new TimeoutState(machine));
|
||||
dictionary.Add(typeof(ChaseState), new ChaseState(machine));
|
||||
dictionary.Add(typeof(AlertState), new AlertState(machine));
|
||||
dictionary.Add(typeof(AttackState), new AttackState(machine));
|
||||
|
||||
machine.InitStateMachine(dictionary);
|
||||
}
|
||||
|
||||
AudioHandler.audioClipHandlers["HO_footsteps"] = SHADE.Audio.CreateAudioClip("event:/Homeowner/homeowner_footsteps");
|
||||
|
||||
patrolPointPool = patrolPointParent.GetComponentsInChildren<Transform>();
|
||||
Transform transform = GetComponent<Transform>();
|
||||
if (transform)
|
||||
{
|
||||
startPos = transform.GlobalPosition;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
attackHitbox.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if(alertCooldown > 0.0f)
|
||||
{
|
||||
alertCooldown -= Time.DeltaTimeF;
|
||||
}
|
||||
else
|
||||
{
|
||||
alertCooldown = 0.0f;
|
||||
}
|
||||
AICheat();
|
||||
}
|
||||
|
||||
public bool ShouldTransitAlert()
|
||||
{
|
||||
AILineOfSight los = GetScript<AILineOfSight>();
|
||||
if (los)
|
||||
{
|
||||
if (los.withinSight && alertCooldown <= 0.0f)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void RotateToPlayer()
|
||||
{
|
||||
|
||||
//Transform playerTransform = player.GetComponent<Transform>();
|
||||
|
||||
////Rotate to face player.
|
||||
//Transform aiTransform = GetComponent<Transform>();
|
||||
//if(playerTransform && aiTransform)
|
||||
//{
|
||||
// Vector3 direction = playerTransform.GlobalPosition - aiTransform.GlobalPosition;
|
||||
// Quaternion currentRotation = aiTransform.LocalRotation;
|
||||
// Quaternion targetRotation = Quaternion.Euler(0.0f, MathF.Atan2(direction.x, direction.z), 0.0f);
|
||||
// aiTransform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, 5.0f * (float)Time.FixedDeltaTime);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
private void AICheat()
|
||||
{
|
||||
StateMachine machine = GetScript<StateMachine>();
|
||||
AILineOfSight los = GetScript<AILineOfSight>();
|
||||
if(machine && los)
|
||||
{
|
||||
if (Input.GetKeyDown(Input.KeyCode.K))
|
||||
{
|
||||
los.range = 5.0f;
|
||||
machine.SetState(typeof(AlertState));
|
||||
}
|
||||
if(Input.GetKeyDown(Input.KeyCode.L))
|
||||
{
|
||||
los.range = 0.0f;
|
||||
machine.SetState(typeof(IdleState));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,19 +13,14 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
|||
{
|
||||
public GameObject aiGO;
|
||||
|
||||
public bool raccoonFound = false;
|
||||
Transform transform;
|
||||
Transform aiTransform;
|
||||
Transform transform;
|
||||
Transform aiTransform;
|
||||
|
||||
[NonSerialized]
|
||||
public PlayerController pc;
|
||||
private HomeOwnerAI ai;
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
transform = GetComponent<Transform>();
|
||||
aiTransform = aiGO.GetComponent<Transform>();
|
||||
ai = aiGO.GetScript<HomeOwnerAI>();
|
||||
transform = GetComponent<Transform>();
|
||||
aiTransform = aiGO.GetComponent<Transform>();
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
|
@ -35,28 +30,29 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
|||
|
||||
transform.GlobalPosition = aiTransform.GlobalPosition + aiTransform.Forward * 0.7f;
|
||||
transform.GlobalEulerAngles = aiTransform.GlobalEulerAngles;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (raccoonFound && pc && ai)
|
||||
{
|
||||
if (!ai.atk)
|
||||
raccoonFound = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void onTriggerStay(CollisionInfo info)
|
||||
{
|
||||
if (info.GameObject.GetScript<PlayerController>())
|
||||
{
|
||||
pc = info.GameObject.GetScript<PlayerController>();
|
||||
if (ai && ai.atk && pc)
|
||||
|
||||
PlayerController pc = info.GameObject.GetScript<PlayerController>();
|
||||
HomeOwnerAI ai = aiGO.GetScript<HomeOwnerAI>();
|
||||
if (pc)
|
||||
{
|
||||
pc.currentState = RaccoonStates.CAUGHT;
|
||||
if (pc.stateMachine && !pc.stateMachine.IsState(typeof(PlayerCaughtState)))
|
||||
pc.stateMachine.SetState(typeof(PlayerCaughtState));
|
||||
|
||||
pc.GotCaught();
|
||||
if (ai)
|
||||
{
|
||||
raccoonFound = true;
|
||||
ai.Reset();
|
||||
GameObject.SetActive(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,23 +37,23 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
|||
{
|
||||
lookOffset = 0.0f;
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// if(left )
|
||||
// {
|
||||
// if (lookOffset > -lookAroundAngle)
|
||||
// lookOffset -= rotationPerSecond * Time.DeltaTimeF;
|
||||
// else
|
||||
// left = false;
|
||||
// }
|
||||
// if (!left)
|
||||
// {
|
||||
// if (lookOffset < lookAroundAngle)
|
||||
// lookOffset += rotationPerSecond * Time.DeltaTimeF;
|
||||
// else
|
||||
// left = false;
|
||||
// }
|
||||
//}
|
||||
else
|
||||
{
|
||||
if(left )
|
||||
{
|
||||
if (lookOffset > -lookAroundAngle)
|
||||
lookOffset -= rotationPerSecond * Time.DeltaTimeF;
|
||||
else
|
||||
left = false;
|
||||
}
|
||||
if (!left)
|
||||
{
|
||||
if (lookOffset < lookAroundAngle)
|
||||
lookOffset += rotationPerSecond * Time.DeltaTimeF;
|
||||
else
|
||||
left = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -75,7 +75,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
|
|||
if(vel.GetMagnitude() > 0.01f)
|
||||
{
|
||||
Quaternion currentRotation = transform.LocalRotation;
|
||||
Quaternion targetRotation = Quaternion.Euler(0.0f, MathF.Atan2(vel.x, vel.z) + lookOffset, 0.0f);
|
||||
Quaternion targetRotation = Quaternion.Euler(0.0f, MathF.Atan2(vel.x, vel.z) + lookOffset, 0.0f);
|
||||
transform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationPerSecond * (float)Time.DeltaTimeF);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,82 +1,54 @@
|
|||
using SHADE;
|
||||
using SHADE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SHADE_Scripting.Audio;
|
||||
|
||||
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
||||
{
|
||||
public class AlertState : AIBaseState
|
||||
{
|
||||
const float alertDuration = 16.0f / 30.0f + 1.0f;
|
||||
float alertTimer = alertDuration;
|
||||
bool firstDetection;
|
||||
public AlertState(StateMachine machine) : base(machine)
|
||||
public class AlertState: AIBaseState
|
||||
{
|
||||
stateName = "Alert";
|
||||
AudioHandler.audioClipHandlers["raccoondetected"] = SHADE.Audio.CreateAudioClip("event:/Raccoon/raccoon_detected");
|
||||
firstDetection = true;
|
||||
}
|
||||
const float alertDuration = 16.0f/30.0f + 1.0f;
|
||||
float alertTimer = alertDuration;
|
||||
|
||||
public override void OnEnter()
|
||||
{
|
||||
alertTimer = alertDuration;
|
||||
if (animator)
|
||||
{
|
||||
animator.PlayOneShot(ai.alertAnim);
|
||||
|
||||
}
|
||||
|
||||
if(firstDetection)
|
||||
{
|
||||
SHADE.Audio.SetParameterWithLabel("HomeownerBark", "DetectFirst");
|
||||
AudioHandler.audioClipHandlers["HO_bark"].Play();
|
||||
firstDetection = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
PlayerController pc = ai.player.GetScript<PlayerController>();
|
||||
|
||||
if (pc && pc.holdItem)
|
||||
public AlertState(StateMachine machine): base(machine)
|
||||
{
|
||||
SHADE.Audio.SetParameterWithLabel("HomeownerBark", "DetectFood");
|
||||
AudioHandler.audioClipHandlers["HO_bark"].Play();
|
||||
}
|
||||
else
|
||||
stateName = "Alert";
|
||||
}
|
||||
|
||||
public override void OnEnter()
|
||||
{
|
||||
SHADE.Audio.SetParameterWithLabel("HomeownerBark", "DetectAgain");
|
||||
AudioHandler.audioClipHandlers["HO_bark"].Play();
|
||||
}
|
||||
|
||||
}
|
||||
SHADE.Audio.SetParameterWithLabel("PlayerDetection", "Detected");
|
||||
alertTimer = alertDuration;
|
||||
if(animator)
|
||||
{
|
||||
animator.PlayOneShot(ai.alertAnim);
|
||||
|
||||
}
|
||||
}
|
||||
public override void OnExit()
|
||||
{
|
||||
animator.Stop();
|
||||
}
|
||||
|
||||
}
|
||||
public override void OnExit()
|
||||
{
|
||||
animator.Stop();
|
||||
}
|
||||
public override void update()
|
||||
{
|
||||
alertTimer -= Time.DeltaTimeF;
|
||||
if (alertTimer <= 0.0f)
|
||||
{
|
||||
machine.SetState(typeof(ChaseState));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
alertTimer -= Time.DeltaTimeF;
|
||||
if (alertTimer <= 0.0f)
|
||||
{
|
||||
machine.SetState(typeof(ChaseState));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void fixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public override void fixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,180 +7,145 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
||||
{
|
||||
public class AttackState : AIBaseState
|
||||
{
|
||||
|
||||
float timer = 0.0f;
|
||||
|
||||
float windupTime = 8.0f / 30.0f;
|
||||
float holdTime = 0.3f;
|
||||
float seqTime = 8.0f / 30.0f;
|
||||
float endTime = 0.5f;
|
||||
|
||||
|
||||
bool windUp = false;
|
||||
bool hold = false;
|
||||
bool seq = false;
|
||||
bool end = false;
|
||||
|
||||
bool raccoonCaught = true;
|
||||
|
||||
|
||||
public AttackState(StateMachine machine) : base(machine)
|
||||
public class AttackState: AIBaseState
|
||||
{
|
||||
stateName = "Attack";
|
||||
}
|
||||
|
||||
float timer = 0.0f;
|
||||
|
||||
float windupTime = 8.0f / 30.0f;
|
||||
float holdTime = 0.3f;
|
||||
float seqTime = 8.0f / 30.0f ;
|
||||
float endTime = 0.5f;
|
||||
|
||||
|
||||
public override void OnEnter()
|
||||
{
|
||||
timer = 0.0f;
|
||||
animator.PlayOneShot(ai.atkWindupAnim);
|
||||
windUp = true;
|
||||
hold = false;
|
||||
seq = false;
|
||||
end = false;
|
||||
timer = windupTime;
|
||||
bool windUp = false;
|
||||
bool hold = false;
|
||||
bool seq = false;
|
||||
bool end = false;
|
||||
|
||||
raccoonCaught = false;
|
||||
|
||||
RotateToVelocity rotate = machine.GetScript<RotateToVelocity>();
|
||||
if (rotate)
|
||||
rotate.active = false;
|
||||
|
||||
RigidBody rigid = machine.GetComponent<RigidBody>();
|
||||
if (rigid)
|
||||
{
|
||||
rigid.LinearVelocity = Vector3.Zero;
|
||||
}
|
||||
Transform transform = machine.GetComponent<Transform>();
|
||||
AILineOfSight los = machine.GetScript<AILineOfSight>();
|
||||
Transform playerTransform = ai.player.GetComponent<Transform>();
|
||||
|
||||
|
||||
if (los && transform)
|
||||
{
|
||||
Vector3 direction = playerTransform.GlobalPosition - transform.GlobalPosition;
|
||||
Quaternion targetRotation = Quaternion.Euler(0.0f, MathF.Atan2(direction.x, direction.z), 0.0f);
|
||||
transform.LocalRotation = targetRotation;
|
||||
|
||||
}
|
||||
|
||||
//ai.attackHitbox.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
public override void OnExit()
|
||||
{
|
||||
|
||||
RotateToVelocity rotate = ai.GetScript<RotateToVelocity>();
|
||||
if (rotate)
|
||||
{
|
||||
rotate.active = true;
|
||||
rotate.lookAround = false;
|
||||
}
|
||||
|
||||
|
||||
//ai.attackHitbox.SetActive(false);
|
||||
machine.GetScript<HomeOwnerAI>().atk = false;
|
||||
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
if (ai.hitboxScript.raccoonFound && machine.GetScript<HomeOwnerAI>().atk)
|
||||
{
|
||||
raccoonCaught = true;
|
||||
Transform pcTransform = ai.player.GetComponent<Transform>();
|
||||
ai.player.GetScript<PlayerController>().Caught();
|
||||
Transform netTransform = ai.attackHitbox.GetComponentInChildren<Transform>();
|
||||
if (pcTransform && netTransform)
|
||||
{
|
||||
pcTransform.GlobalPosition = netTransform.GlobalPosition;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
timer -= Time.DeltaTimeF;
|
||||
if (windUp)
|
||||
{
|
||||
if (timer <= 0.0f)
|
||||
public AttackState(StateMachine machine): base(machine)
|
||||
{
|
||||
windUp = false;
|
||||
hold = true;
|
||||
animator.Play(ai.atkHoldAnim);
|
||||
timer = holdTime;
|
||||
//ai.attackHitbox.SetActive(true);
|
||||
//machine.GetScript<HomeOwnerAI>().atk = true;
|
||||
}
|
||||
}
|
||||
else if (hold)
|
||||
{
|
||||
if (timer <= 0.0f)
|
||||
{
|
||||
hold = false;
|
||||
seq = true;
|
||||
animator.PlayOneShot(ai.atkSeqAnim);
|
||||
timer = seqTime;
|
||||
}
|
||||
}
|
||||
else if (seq)
|
||||
{
|
||||
|
||||
if (timer <= seqTime * 0.5f)
|
||||
{
|
||||
//ai.attackHitbox.SetActive(true);
|
||||
machine.GetScript<HomeOwnerAI>().atk = true;
|
||||
}
|
||||
|
||||
if (timer <= 0.0f)
|
||||
{
|
||||
seq = false;
|
||||
end = true;
|
||||
|
||||
timer = endTime;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if (end)
|
||||
{
|
||||
if (timer <= 0.0f)
|
||||
{
|
||||
end = false;
|
||||
|
||||
if(raccoonCaught)
|
||||
{
|
||||
machine.SetState(typeof(CaughtRaccoonState));
|
||||
}
|
||||
else
|
||||
{
|
||||
AILineOfSight los = ai.GetScript<AILineOfSight>();
|
||||
if (los && los.withinSight)
|
||||
{
|
||||
machine.SetState(typeof(ChaseState));
|
||||
}
|
||||
else
|
||||
{
|
||||
machine.SetState(typeof(TimeoutState));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public override void OnEnter()
|
||||
{
|
||||
timer = 0.0f;
|
||||
animator.PlayOneShot(ai.atkWindupAnim);
|
||||
windUp = true;
|
||||
hold = false;
|
||||
seq = false;
|
||||
end = false;
|
||||
timer = windupTime;
|
||||
|
||||
RotateToVelocity rotate = machine.GetScript<RotateToVelocity>();
|
||||
if (rotate)
|
||||
rotate.active = false;
|
||||
|
||||
RigidBody rigid = machine.GetComponent<RigidBody>();
|
||||
if(rigid)
|
||||
{
|
||||
rigid.LinearVelocity = Vector3.Zero;
|
||||
}
|
||||
Transform transform = machine.GetComponent<Transform>();
|
||||
AILineOfSight los = machine.GetScript<AILineOfSight>();
|
||||
Transform playerTransform = ai.player.GetComponent<Transform>();
|
||||
|
||||
|
||||
if (los && transform)
|
||||
{
|
||||
Vector3 direction = playerTransform.GlobalPosition - transform.GlobalPosition;
|
||||
Quaternion targetRotation = Quaternion.Euler(0.0f, MathF.Atan2(direction.x, direction.z), 0.0f);
|
||||
transform.LocalRotation = targetRotation;
|
||||
|
||||
}
|
||||
|
||||
ai.attackHitbox.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
public override void OnExit()
|
||||
{
|
||||
animator.Stop();
|
||||
RotateToVelocity rotate = ai.GetScript<RotateToVelocity>();
|
||||
if (rotate)
|
||||
{
|
||||
rotate.active = true;
|
||||
rotate.lookAround = false;
|
||||
}
|
||||
|
||||
|
||||
ai.attackHitbox.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
timer -= Time.DeltaTimeF;
|
||||
if(windUp)
|
||||
{
|
||||
if(timer <= 0.0f)
|
||||
{
|
||||
windUp = false;
|
||||
hold = true;
|
||||
animator.Play(ai.atkHoldAnim);
|
||||
timer = holdTime;
|
||||
ai.attackHitbox.SetActive(true);
|
||||
}
|
||||
}
|
||||
else if(hold)
|
||||
{
|
||||
if(timer <= 0.0f)
|
||||
{
|
||||
hold = false;
|
||||
seq = true;
|
||||
animator.PlayOneShot(ai.atkSeqAnim);
|
||||
timer = seqTime;
|
||||
}
|
||||
}
|
||||
else if(seq)
|
||||
{
|
||||
|
||||
if(timer <= 1.0f / 30.0f)
|
||||
{
|
||||
ai.attackHitbox.SetActive(true);
|
||||
}
|
||||
|
||||
if(timer <= 0.0f)
|
||||
{
|
||||
seq = false;
|
||||
end = true;
|
||||
|
||||
timer = endTime;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if(end)
|
||||
{
|
||||
if(timer <= 0.0f)
|
||||
{
|
||||
end = false;
|
||||
AILineOfSight los = ai.GetScript<AILineOfSight>();
|
||||
if (los && los.withinSight)
|
||||
{
|
||||
machine.SetState(typeof(ChaseState));
|
||||
}
|
||||
else
|
||||
{
|
||||
machine.SetState(typeof(TimeoutState));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void fixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void fixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SHADE;
|
||||
using static PlayerController;
|
||||
|
||||
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
||||
{
|
||||
public class CaughtRaccoonState: AIBaseState
|
||||
{
|
||||
|
||||
private float timer = 0.0f;
|
||||
private PlayerController pc;
|
||||
|
||||
public CaughtRaccoonState(StateMachine machine):base(machine)
|
||||
{
|
||||
stateName = "Caught Raccoon";
|
||||
}
|
||||
|
||||
public override void OnEnter()
|
||||
{
|
||||
if(ai.hitboxScript)
|
||||
pc = ai.hitboxScript.pc;
|
||||
|
||||
timer = ai.caughtDuration;
|
||||
if (pc)
|
||||
pc.Caught();
|
||||
}
|
||||
|
||||
|
||||
public override void OnExit()
|
||||
{
|
||||
animator.Stop();
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
timer -= Time.DeltaTimeF;
|
||||
if(timer <= 0.0f)
|
||||
{
|
||||
if (pc)
|
||||
{
|
||||
|
||||
pc.Reset();
|
||||
}
|
||||
ai.Reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
Transform pcTransform = pc.GetComponent<Transform>();
|
||||
Transform netTransform = ai.attackHitbox.GetComponentInChildren<Transform>();
|
||||
if (pcTransform && netTransform)
|
||||
{
|
||||
pcTransform.GlobalPosition = netTransform.GlobalPosition;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void fixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Name: CaughtRaccoonState
|
||||
ID: 153010954
|
||||
Type: 9
|
|
@ -14,7 +14,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
|
||||
float giveUpDuration = 10.0f;
|
||||
float giveUpTimer = 0.0f;
|
||||
float atkDistance = 1.0f;
|
||||
float atkDistance = 2.0f;
|
||||
|
||||
|
||||
bool run = true;
|
||||
|
@ -22,16 +22,10 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
float footStepInterval = 12.0f / 30.0f;
|
||||
float footStepTimer = 0.0f;
|
||||
|
||||
float barkTimer = 0.0f;
|
||||
|
||||
Random rand;
|
||||
|
||||
|
||||
|
||||
public ChaseState(StateMachine machine): base(machine)
|
||||
{
|
||||
stateName = "Chase";
|
||||
rand = new Random();
|
||||
}
|
||||
|
||||
public override void OnEnter()
|
||||
|
@ -48,9 +42,6 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
|
||||
|
||||
footStepTimer = footStepInterval * 0.5f;
|
||||
|
||||
|
||||
barkTimer = (float)rand.Next(0, 2) + (float)rand.NextDouble();
|
||||
}
|
||||
|
||||
public override void OnExit()
|
||||
|
@ -66,25 +57,11 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
{
|
||||
rotate.lookAround = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
barkTimer -= Time.DeltaTimeF;
|
||||
if(barkTimer <= 0.0f)
|
||||
{
|
||||
barkTimer = (float)rand.Next(4, 6) + (float)rand.NextDouble();
|
||||
|
||||
SHADE.Audio.SetParameterWithLabel("HomeownerBark", "Chase");
|
||||
AudioHandler.audioClipHandlers["HO_bark"].Play();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Navigation nav = machine.GetComponent<Navigation>();
|
||||
Navigation nav = machine.GetComponent<Navigation>();
|
||||
AILineOfSight los = ai.GetScript<AILineOfSight>();
|
||||
RigidBody rigid = machine.GetComponent<RigidBody>();
|
||||
if (los && nav)
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
{
|
||||
timer = 0.0f;
|
||||
animator.Play(ai.idleAnim);
|
||||
SHADE.Audio.SetParameterWithLabel("PlayerDetection", "Undetected");
|
||||
RotateToVelocity rotate = ai.GetScript<RotateToVelocity>();
|
||||
if (rotate)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,6 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
|
||||
animator.Play(ai.walkingAnim);
|
||||
AudioHandler.audioClipHandlers["HO_footsteps"].Play();
|
||||
AudioHandler.audioClipHandlers["HO_humming"].Play();
|
||||
footStepTimer = footStepInterval;
|
||||
|
||||
|
||||
|
@ -65,8 +64,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
public override void OnExit()
|
||||
{
|
||||
animator.Stop();
|
||||
AudioHandler.audioClipHandlers["HO_humming"].Stop(false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SHADE;
|
||||
using SHADE_Scripting.Audio;
|
||||
|
||||
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
||||
{
|
||||
|
@ -24,10 +23,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
|
|||
timer = 0.0f;
|
||||
animator.Play(ai.idleAnim);
|
||||
|
||||
SHADE.Audio.SetParameterWithLabel("HomeownerBark", "DetectLost");
|
||||
AudioHandler.audioClipHandlers["HO_bark"].Play();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
|
|
|
@ -14,6 +14,9 @@ public class Breakable : Script
|
|||
public bool isBreak { get; set; }
|
||||
private List<GameObject> itemPieces = new List<GameObject>();
|
||||
|
||||
[SerializeField]
|
||||
private string breakClipHandlerName;
|
||||
|
||||
[SerializeField]
|
||||
private string breakClipPath;
|
||||
|
||||
|
@ -35,8 +38,7 @@ public class Breakable : Script
|
|||
|
||||
isBreak = false;
|
||||
|
||||
AudioHandler.audioClipHandlers["break"] = Audio.CreateAudioClip(breakClipPath);
|
||||
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["break"], GameObject.EntityId);
|
||||
AudioHandler.audioClipHandlers[breakClipHandlerName] = Audio.CreateAudioClip(breakClipPath);
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
|
@ -79,7 +81,9 @@ public class Breakable : Script
|
|||
|
||||
GameManager.Instance.itemShatter = false;
|
||||
isBreak = false;
|
||||
AudioHandler.audioClipHandlers["break"].Play();
|
||||
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers[breakClipHandlerName], GameObject.EntityId);
|
||||
AudioHandler.audioClipHandlers[breakClipHandlerName].Play();
|
||||
//Audio.DetachAudioClipFromObject(AudioHandler.audioClipHandlers[breakClipHandlerName]);
|
||||
GameObject.SetActive(false);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
using SHADE;
|
||||
using SHADE_Scripting.Audio;
|
||||
using SHADE_Scripting.Gameplay.AIBehaviour.AIRework;
|
||||
using System;
|
||||
public class Item : Script
|
||||
{
|
||||
|
@ -27,12 +26,14 @@ public class Item : Script
|
|||
public bool returnBack { get; set; }
|
||||
private Transform transform;
|
||||
private RigidBody rb;
|
||||
private bool playSound = false;
|
||||
private bool caputurePos = false;
|
||||
private Vector3 firstPostion;
|
||||
private Vector3 firstRotation;
|
||||
public bool dontReturn = false;
|
||||
private bool once = true;
|
||||
|
||||
|
||||
private bool checkSound = false;
|
||||
private bool homeownerOnce = true;
|
||||
public float soundDistance = 10;
|
||||
|
||||
|
@ -59,11 +60,6 @@ public class Item : Script
|
|||
AudioHandler.audioClipHandlers["SFXImpactElastic"] = Audio.CreateAudioClip("event:/Props/impact_elastic");
|
||||
AudioHandler.audioClipHandlers["SFXImpactHard"] = Audio.CreateAudioClip("event:/Props/impact_hard");
|
||||
|
||||
if (currCategory == ItemCategory.LIGHT)
|
||||
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXImpactElastic"], GameObject.EntityId);
|
||||
else if (currCategory == ItemCategory.MEDIUM || currCategory == ItemCategory.HEAVY)
|
||||
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXImpactHard"], GameObject.EntityId);
|
||||
|
||||
emitter = GetComponent<ParticleEmitter>();
|
||||
}
|
||||
|
||||
|
@ -118,6 +114,19 @@ public class Item : Script
|
|||
returnBack = false;
|
||||
}
|
||||
|
||||
|
||||
if (checkSound)
|
||||
{
|
||||
/* //need to wait for collisionEnter Fix
|
||||
Vector3 itemPos = transform.LocalPosition;
|
||||
Vector3 len = Homeowner1.aiInstance.GetComponent<Transform>().LocalPosition - itemPos;
|
||||
Debug.Log($"distance: {len.GetSqrMagnitude()}");
|
||||
if (len.GetSqrMagnitude() <= soundDistance)
|
||||
{
|
||||
//set ai to alert
|
||||
}
|
||||
checkSound = false;*/
|
||||
}
|
||||
}
|
||||
|
||||
protected override void onCollisionEnter(CollisionInfo info)
|
||||
|
@ -130,21 +139,23 @@ public class Item : Script
|
|||
caputurePos = true;
|
||||
}
|
||||
|
||||
if (once)
|
||||
if (playSound)
|
||||
{
|
||||
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXImpactElastic"], GameObject.EntityId);
|
||||
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXImpactHard"], GameObject.EntityId);
|
||||
if (currCategory == ItemCategory.LIGHT)
|
||||
AudioHandler.audioClipHandlers["SFXImpactElastic"].Play();
|
||||
else if (currCategory == ItemCategory.MEDIUM || currCategory == ItemCategory.HEAVY)
|
||||
AudioHandler.audioClipHandlers["SFXImpactHard"].Play();
|
||||
playSound = false;
|
||||
Audio.DetachAudioClipFromObject(AudioHandler.audioClipHandlers["SFXImpactElastic"]);
|
||||
Audio.DetachAudioClipFromObject(AudioHandler.audioClipHandlers["SFXImpactHard"]);
|
||||
|
||||
if (emitter)
|
||||
if(emitter)
|
||||
emitter.Emit();
|
||||
|
||||
once = false;
|
||||
}
|
||||
|
||||
|
||||
if (info.GameObject.GetScript<HomeOwnerAI>() && homeownerOnce)
|
||||
if (info.GameObject.GetScript<Homeowner1>() && homeownerOnce)
|
||||
{
|
||||
homeownerOnce = false;
|
||||
returnBack = true;
|
||||
|
@ -153,8 +164,9 @@ public class Item : Script
|
|||
|
||||
protected override void onCollisionExit(CollisionInfo info)
|
||||
{
|
||||
playSound = true;
|
||||
checkSound = true;
|
||||
homeownerOnce = true;
|
||||
once = true;
|
||||
}
|
||||
|
||||
}
|
|
@ -474,7 +474,7 @@ public class PickAndThrow : Script
|
|||
}
|
||||
}
|
||||
|
||||
public void TweenAimCamArm(bool aim)
|
||||
private void TweenAimCamArm(bool aim)
|
||||
{
|
||||
|
||||
if (aim)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using SHADE;
|
||||
using SHADE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SHADE_Scripting.Audio;
|
||||
|
@ -22,10 +22,7 @@ public class PlayerController : Script
|
|||
public Transform tranform { get; set; }
|
||||
public Camera cam { get; set; }
|
||||
public CameraArm camArm { get; set; }
|
||||
public Collider collider { get; set; }
|
||||
|
||||
[NonSerialized]
|
||||
public PickAndThrow pat;
|
||||
private PickAndThrow pat;
|
||||
public StateMachine stateMachine { get; set; }
|
||||
public ParticleEmitter Leftsmoke { get; set; }
|
||||
public ParticleEmitter Rightsmoke { get; set; }
|
||||
|
@ -125,10 +122,6 @@ public class PlayerController : Script
|
|||
if(!tranform)
|
||||
Debug.LogError("tranform is MISSING!");
|
||||
|
||||
collider = GetComponent<Collider>();
|
||||
if (!collider)
|
||||
Debug.LogError("collider is MISSING!");
|
||||
|
||||
stateMachine = AddScript<StateMachine>();
|
||||
Dictionary<Type, BaseState> dictionary = new Dictionary<Type, BaseState>();
|
||||
dictionary.Add(typeof(PlayerIdleState), new PlayerIdleState(stateMachine));
|
||||
|
@ -196,7 +189,7 @@ public class PlayerController : Script
|
|||
float ratio = System.Math.Clamp(1 - (disSqr / (1 + disSqr)), 0, 1.0f);
|
||||
float temp = (1 - ratio) * 0.00075f;
|
||||
if (temp <= 0.0006f)
|
||||
temp = 0.0075f;
|
||||
temp = 0.1f;
|
||||
silhouettePlayerRend.Material.SetProperty<float>("data.offset", temp);
|
||||
silhouetteBagRend.Material.SetProperty<float>("data.offset", temp);
|
||||
}
|
||||
|
@ -234,7 +227,7 @@ public class PlayerController : Script
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
GotCaught();
|
||||
Rotation();
|
||||
MoveKey();
|
||||
Sprint();
|
||||
|
@ -261,10 +254,6 @@ public class PlayerController : Script
|
|||
|
||||
private void MoveKey()
|
||||
{
|
||||
|
||||
if (currentState == RaccoonStates.CAUGHT)
|
||||
return;
|
||||
|
||||
axisMove = Vector2.Zero;
|
||||
if (Input.GetKey(Input.KeyCode.W))
|
||||
{
|
||||
|
@ -301,7 +290,7 @@ public class PlayerController : Script
|
|||
axisMove.Normalise();
|
||||
isMoveKeyPress = axisMove.x != 0 || axisMove.y != 0;
|
||||
|
||||
if (isMoveKeyPress && isGrounded && !Input.GetKey(Input.KeyCode.LeftShift) && currentState != RaccoonStates.CAUGHT)
|
||||
if (isMoveKeyPress && isGrounded && !Input.GetKey(Input.KeyCode.LeftShift))
|
||||
{
|
||||
currentState = RaccoonStates.WALKING;
|
||||
|
||||
|
@ -345,9 +334,6 @@ public class PlayerController : Script
|
|||
|
||||
private void Sprint()
|
||||
{
|
||||
if (currentState == RaccoonStates.CAUGHT)
|
||||
return;
|
||||
|
||||
if (Input.GetKey(Input.KeyCode.LeftShift) && isMoveKeyPress && isGrounded)
|
||||
{
|
||||
currentState = RaccoonStates.RUNNING;
|
||||
|
@ -357,9 +343,6 @@ public class PlayerController : Script
|
|||
if (pat && holdItem)
|
||||
{
|
||||
holdItem = false;
|
||||
isAiming = false;
|
||||
cam.FOV = Settings.cameraFOV;
|
||||
pat.TweenAimCamArm(false);
|
||||
pat.SetItemGravityBack();
|
||||
pat.ResetItemObject();
|
||||
}
|
||||
|
@ -440,13 +423,10 @@ public class PlayerController : Script
|
|||
}
|
||||
|
||||
if (!isGrounded && rb != null && (rb.LinearVelocity.y < 0.0f || Input.GetKeyUp(Input.KeyCode.Space)))
|
||||
{
|
||||
if (currentState != RaccoonStates.CAUGHT)
|
||||
{
|
||||
currentState = RaccoonStates.FALLING;
|
||||
if (stateMachine && !stateMachine.IsState(typeof(PlayerFallState)))
|
||||
stateMachine.SetState(typeof(PlayerFallState));
|
||||
}
|
||||
{
|
||||
currentState = RaccoonStates.FALLING;
|
||||
if (stateMachine && !stateMachine.IsState(typeof(PlayerFallState)))
|
||||
stateMachine.SetState(typeof(PlayerFallState));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -471,9 +451,6 @@ public class PlayerController : Script
|
|||
|
||||
private void Gravity()
|
||||
{
|
||||
if (currentState == RaccoonStates.CAUGHT)
|
||||
return;
|
||||
|
||||
if (rb != null)
|
||||
{
|
||||
//check player vel.y if its close to zero its on the ground
|
||||
|
@ -525,54 +502,36 @@ public class PlayerController : Script
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void Caught()
|
||||
public void GotCaught()
|
||||
{
|
||||
currentState = RaccoonStates.CAUGHT;
|
||||
if (stateMachine && !stateMachine.IsState(typeof(PlayerCaughtState)))
|
||||
stateMachine.SetState(typeof(PlayerCaughtState));
|
||||
|
||||
AudioHandler.audioClipHandlers["RaccoonCaught"].Play();
|
||||
if (pat && pat.item)
|
||||
if (currentState == RaccoonStates.CAUGHT && tranform && respawnPoint)
|
||||
{
|
||||
if (holdItem)
|
||||
{
|
||||
holdItem = false;
|
||||
pat.item.GetScript<Item>().returnBack = true;
|
||||
pat.SetItemGravityBack();
|
||||
pat.ResetItemObject();
|
||||
}
|
||||
if (isAiming)
|
||||
{
|
||||
isAiming = false;
|
||||
cam.FOV = Settings.cameraFOV;
|
||||
camArm.TargetOffset = pat.prevTargetOffSet;
|
||||
camArm.ArmLength = pat.tpc.armLength;
|
||||
}
|
||||
}
|
||||
|
||||
landedOnJumpPad = false;
|
||||
jumpPadDrop = false;
|
||||
rb.ClearForces();
|
||||
rb.ClearTorque();
|
||||
rb.LinearVelocity = Vector3.Zero;
|
||||
rb.AngularVelocity = Vector3.Zero;
|
||||
collider.GetCollisionShape(0).IsTrigger = true;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
if (tranform && respawnPoint)
|
||||
{
|
||||
|
||||
AudioHandler.audioClipHandlers["RaccoonCaught"].Play();
|
||||
currentState = RaccoonStates.IDLE;
|
||||
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
|
||||
stateMachine.SetState(typeof(PlayerIdleState));
|
||||
|
||||
collider.GetCollisionShape(0).IsTrigger = false;
|
||||
tranform.GlobalPosition = respawnPoint.GetComponent<Transform>().GlobalPosition;
|
||||
|
||||
GameManager.Instance.RacoonCaught();
|
||||
|
||||
if (pat && pat.item)
|
||||
{
|
||||
if (holdItem)
|
||||
{
|
||||
holdItem = false;
|
||||
pat.item.GetScript<Item>().returnBack = true;
|
||||
pat.SetItemGravityBack();
|
||||
pat.ResetItemObject();
|
||||
}
|
||||
if (isAiming)
|
||||
{
|
||||
isAiming = false;
|
||||
cam.FOV = Settings.cameraFOV;
|
||||
camArm.TargetOffset = pat.prevTargetOffSet;
|
||||
camArm.ArmLength = pat.tpc.armLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
using SHADE;
|
||||
using SHADE_Scripting.Audio;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class DecorationAudio : Script
|
||||
{
|
||||
public string name = "REPLACETHIS";
|
||||
public string audio = "event:/UI/botton_hover";
|
||||
public bool loop = true;
|
||||
public float timeDruation = 0.5f;
|
||||
private float timer = 0.0f;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
if (audio != "Empty")
|
||||
{
|
||||
AudioHandler.audioClipHandlers[name] = Audio.CreateAudioClip(audio);
|
||||
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers[name], GameObject.EntityId);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
if (loop)
|
||||
AudioHandler.audioClipHandlers[name].Play();
|
||||
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if (!loop)
|
||||
{
|
||||
timer += Time.DeltaTimeF;
|
||||
if (timer > timeDruation)
|
||||
{
|
||||
timer = 0.0f;
|
||||
AudioHandler.audioClipHandlers[name].Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Name: SC_DecorationAudio
|
||||
ID: 166447267
|
||||
Type: 9
|
|
@ -10,10 +10,12 @@ public class GameManager : Script
|
|||
public enum GameState
|
||||
{
|
||||
START,
|
||||
OVER
|
||||
WIN,
|
||||
LOSE
|
||||
}
|
||||
|
||||
public uint winScene = 92009475;
|
||||
public uint loseScene = 91685359;
|
||||
|
||||
[NonSerialized]
|
||||
public GameState currGameState;
|
||||
|
@ -25,16 +27,9 @@ public class GameManager : Script
|
|||
public float timer;
|
||||
|
||||
public GameObject scoreText;
|
||||
public GameObject scoreTextBG;
|
||||
public GameObject timeText;
|
||||
public GameObject minusTimerText;
|
||||
|
||||
public GameObject Results;
|
||||
public int MaxComboAccquired { get; set; }
|
||||
public int finalTime { get; set; }
|
||||
public int finalScore { get; set; }
|
||||
|
||||
|
||||
//mulitpler info
|
||||
public GameObject multiplierText;
|
||||
public float maxMultiplierDuration = 5.0f;
|
||||
|
@ -53,9 +48,8 @@ public class GameManager : Script
|
|||
public bool itemShatter { get; set; }
|
||||
|
||||
//For scene transitions
|
||||
private bool waitForTransition;
|
||||
|
||||
private bool playSpeedUp = false;
|
||||
private bool goingToWin;
|
||||
private bool goingToLose;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
|
@ -68,7 +62,7 @@ public class GameManager : Script
|
|||
Score = 0;
|
||||
currGameState = GameState.START;
|
||||
itemScored = false;
|
||||
currMultiplierCombo = 0;
|
||||
currMultiplierCombo = 1;
|
||||
currMultiplierDuration = 0;
|
||||
itemShatter = false;
|
||||
GamePause = false;
|
||||
|
@ -83,7 +77,8 @@ public class GameManager : Script
|
|||
loseAudio.DestroyOnSceneExit = false;
|
||||
AudioHandler.audioClipHandlers["BGMLose"] = loseAudio;
|
||||
|
||||
waitForTransition = false;
|
||||
goingToWin = false;
|
||||
goingToLose = false;
|
||||
|
||||
if (scoreText)
|
||||
scoreText.GetComponent<TextRenderable>().Text = $"{Score}";
|
||||
|
@ -96,7 +91,6 @@ public class GameManager : Script
|
|||
|
||||
AudioHandler.audioClipHandlers["SFXItemScore"] = Audio.CreateAudioClip("event:/Music/stingers/item_scored");
|
||||
AudioHandler.audioClipHandlers["RaccoonScored"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_scored");
|
||||
Audio.SetParameterWithLabel("PlaybackSpeed", "Normal");
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
|
@ -109,11 +103,16 @@ public class GameManager : Script
|
|||
AudioHandler.audioClipHandlers["KitchenAmbience"] = Audio.CreateAudioClip("event:/Ambience/roomtone_kitchen");
|
||||
AudioHandler.audioClipHandlers["KitchenAmbience"].Play();
|
||||
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeOut();
|
||||
|
||||
GamePause = false;
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
|
||||
|
||||
if (GamePause || !stealFoodPopUpDone)
|
||||
{
|
||||
return;
|
||||
|
@ -122,80 +121,104 @@ public class GameManager : Script
|
|||
Cheat();
|
||||
|
||||
if (currGameState == GameState.START)
|
||||
{
|
||||
{
|
||||
timer -= Time.DeltaTimeF;
|
||||
|
||||
if (timer < 30.0f && !playSpeedUp)
|
||||
{
|
||||
Audio.SetParameterWithLabel("PlaybackSpeed", "ToTransition");
|
||||
playSpeedUp = true;
|
||||
}
|
||||
|
||||
if (scoreText)
|
||||
if(scoreText)
|
||||
scoreText.GetComponent<TextRenderable>().Text = $"{Score}";
|
||||
if (timeText)
|
||||
timeText.GetComponent<TextRenderable>().Text = $"{timer.ToString("0")}";
|
||||
if(timeText)
|
||||
timeText.GetComponent<TextRenderable>().Text = $"{timer.ToString("0.00")}";
|
||||
|
||||
if (itemScored)
|
||||
{
|
||||
currMultiplierDuration += Time.DeltaTimeF;
|
||||
|
||||
if (currMultiplierDuration >= maxMultiplierDuration)
|
||||
{
|
||||
{
|
||||
itemScored = false;
|
||||
currMultiplierCombo = 0;
|
||||
currMultiplierCombo = 1;
|
||||
currMultiplierDuration = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (timer <= 0 || (totalItemCount <= 0 && !itemShatter))
|
||||
if (!goingToLose && ((timer > 0 && totalItemCount <= 0 && !itemShatter)))
|
||||
{
|
||||
currGameState = GameState.WIN;
|
||||
AudioHandler.StopAllSounds(false);
|
||||
|
||||
if (timer <= 0)
|
||||
AudioHandler.audioClipHandlers["BGMLose"].Play();
|
||||
else if (totalItemCount <= 0)
|
||||
AudioHandler.audioClipHandlers["BGMWin"].Play();
|
||||
|
||||
currGameState = GameState.OVER;
|
||||
finalTime = (int)timer;
|
||||
Results.SetActive(true);
|
||||
|
||||
Input.SetMouseCentering(false);
|
||||
Application.IsCursorVisible = true;
|
||||
GamePause = true;
|
||||
Application.FixDeltaTime = 0;
|
||||
AnimationSystem.TimeScale = 0;
|
||||
AudioHandler.audioClipHandlers["BGMWin"].Play();
|
||||
goingToWin = true;
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
else if(!goingToWin && (timer < 0))
|
||||
{
|
||||
currGameState = GameState.LOSE;
|
||||
AudioHandler.StopAllSounds(false);
|
||||
AudioHandler.audioClipHandlers["BGMLose"].Play();
|
||||
goingToLose = true;
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (SceneFadeInOut.Instance && SceneFadeInOut.Instance.FadeInFinished() && waitForTransition)
|
||||
SceneManager.ChangeScene(winScene);
|
||||
|
||||
//Handling transitions
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
{
|
||||
if (SceneFadeInOut.Instance.FadeInFinished())
|
||||
{
|
||||
if (goingToWin)
|
||||
{
|
||||
SceneManager.ChangeScene(winScene);
|
||||
}
|
||||
if (goingToLose)
|
||||
{
|
||||
SceneManager.ChangeScene(loseScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (goingToWin)
|
||||
{
|
||||
SceneManager.ChangeScene(winScene);
|
||||
}
|
||||
if (goingToLose)
|
||||
{
|
||||
SceneManager.ChangeScene(loseScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RacoonCaught()
|
||||
{
|
||||
timer -= 10.0f;
|
||||
if (minusTimerText != GameObject.Null)
|
||||
{
|
||||
MinusTimerText text = minusTimerText.GetScript<MinusTimerText>();
|
||||
if (text)
|
||||
{
|
||||
text.Reset();
|
||||
}
|
||||
timer -= 10.0f;
|
||||
if(minusTimerText != GameObject.Null)
|
||||
{
|
||||
MinusTimerText text =minusTimerText.GetScript<MinusTimerText>();
|
||||
if(text)
|
||||
{
|
||||
text.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Cheat()
|
||||
{
|
||||
if (Input.GetKeyUp(Input.KeyCode.F1))
|
||||
{
|
||||
currGameState = GameState.OVER;
|
||||
currGameState = GameState.WIN;
|
||||
AudioHandler.audioClipHandlers["BGMWin"].Play();
|
||||
AudioHandler.StopAllSounds(false);
|
||||
waitForTransition = true;
|
||||
goingToWin = true;
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
else if (Input.GetKeyUp(Input.KeyCode.F2))
|
||||
{
|
||||
currGameState = GameState.LOSE;
|
||||
AudioHandler.audioClipHandlers["BGMLose"].Play();
|
||||
AudioHandler.StopAllSounds(false);
|
||||
goingToLose = true;
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
|
@ -222,35 +245,23 @@ public class GameManager : Script
|
|||
currMultiplierDuration = 0;
|
||||
|
||||
if (currMultiplierCombo < maxMultiplierCombo)
|
||||
{
|
||||
currMultiplierCombo += 1;
|
||||
if (currMultiplierCombo > MaxComboAccquired)
|
||||
MaxComboAccquired = currMultiplierCombo;
|
||||
}
|
||||
|
||||
Audio.SetParameter("Multiplier", currMultiplierCombo);
|
||||
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
|
||||
AudioHandler.audioClipHandlers["RaccoonScored"].Play();
|
||||
|
||||
SingleScaleBounce textBounce = scoreText.GetScript<SingleScaleBounce>();
|
||||
SingleScaleBounce textBGBounce = scoreTextBG.GetScript<SingleScaleBounce>();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if (textBounce)
|
||||
textBounce.ScaleBounceOnce();*/
|
||||
|
||||
if (textBGBounce)
|
||||
textBGBounce.ScaleBounceOnce();
|
||||
|
||||
|
||||
MultiplierTextFx fx = multiplierText.GetScript<MultiplierTextFx>();
|
||||
MultiplierTextFx fx = multiplierText.GetScript<MultiplierTextFx>();
|
||||
if (fx)
|
||||
{
|
||||
fx.ShowMultiplier(currMultiplierCombo, maxMultiplierDuration);
|
||||
}
|
||||
|
||||
SingleScaleBounce sb = scoreText.GetScript<SingleScaleBounce>();
|
||||
if(sb)
|
||||
{
|
||||
sb.ScaleBounceOnce();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace SHADE_Scripting.UI
|
|||
public class PreviewLevel : Script
|
||||
{
|
||||
private List<Camera> listOfCamera;
|
||||
public GameObject levelTransistion;
|
||||
|
||||
public Vector3 endPoint1;
|
||||
public Vector3 endPoint2;
|
||||
|
@ -57,7 +56,7 @@ namespace SHADE_Scripting.UI
|
|||
|
||||
protected override void update()
|
||||
{
|
||||
if (SceneFadeInOut.Instance && !levelTransistion.GetScript<LevelTransistion>().complete && !point1Done)
|
||||
if (SceneFadeInOut.Instance && !SceneFadeInOut.Instance.FadeOutFinished() && !point1Done)
|
||||
{
|
||||
moveToEndPoint1.Reset();
|
||||
return;
|
||||
|
|
|
@ -22,11 +22,7 @@ public class ScoringZone : Script
|
|||
{
|
||||
if (GameManager.Instance && info.GameObject.GetScript<Item>() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent<Collider>().GetCollisionShape(0).IsTrigger )
|
||||
{
|
||||
if (GameManager.Instance.currMultiplierCombo > 1)
|
||||
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo;
|
||||
else
|
||||
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score;
|
||||
|
||||
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo;
|
||||
GameManager.Instance.ItemScored();
|
||||
particle.EmissionCount = startingParticleCount * GameManager.Instance.currMultiplierCombo;
|
||||
particle.Emit();
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public enum EASING_METHOD
|
||||
{
|
||||
EASE_IN_SINE,
|
||||
EASE_OUT_SINE,
|
||||
EASE_OUT_BOUNCE,
|
||||
EASE_IN_BOUNCE,
|
||||
EASE_INOUT_BOUNCE,
|
||||
EASE_OUT_CIRCLE,
|
||||
EASE_OUT_BACK,
|
||||
LINEAR
|
||||
}
|
||||
public enum EASING_METHOD
|
||||
{
|
||||
EASE_IN_SINE,
|
||||
EASE_OUT_SINE,
|
||||
EASE_OUT_BOUNCE,
|
||||
EASE_IN_BOUNCE,
|
||||
EASE_INOUT_BOUNCE,
|
||||
LINEAR
|
||||
}
|
||||
|
||||
public static class EasingHelper
|
||||
{
|
||||
|
@ -27,41 +25,33 @@ public static class EasingHelper
|
|||
{
|
||||
return EaseInSine(value);
|
||||
}
|
||||
|
||||
|
||||
case EASING_METHOD.EASE_OUT_SINE:
|
||||
{
|
||||
return EaseOutSine(value);
|
||||
}
|
||||
|
||||
|
||||
case EASING_METHOD.EASE_OUT_BOUNCE:
|
||||
{
|
||||
return EaseOutBounce(value);
|
||||
}
|
||||
|
||||
|
||||
case EASING_METHOD.EASE_IN_BOUNCE:
|
||||
{
|
||||
return EaseInBounce(value);
|
||||
}
|
||||
|
||||
|
||||
case EASING_METHOD.EASE_INOUT_BOUNCE:
|
||||
{
|
||||
return EaseInOutBounce(value);
|
||||
}
|
||||
|
||||
|
||||
case EASING_METHOD.LINEAR:
|
||||
{
|
||||
return value;
|
||||
}
|
||||
case EASING_METHOD.EASE_OUT_CIRCLE:
|
||||
{
|
||||
return EaseOutCircle(value);
|
||||
}
|
||||
case EASING_METHOD.EASE_OUT_BACK:
|
||||
{
|
||||
return EaseOutBack(value);
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
@ -112,18 +102,5 @@ public static class EasingHelper
|
|||
: (1.0f + EaseOutBounce(2.0f * value - 1.0f)) / 2.0f;
|
||||
}
|
||||
|
||||
|
||||
private static float EaseOutCircle(float value)
|
||||
{
|
||||
return (float)Math.Sqrt(1.0f - (float)Math.Pow(value - 1.0f, 2.0f));
|
||||
}
|
||||
|
||||
private static float EaseOutBack(float value)
|
||||
{
|
||||
const float c1 = 1.70158f;
|
||||
const float c3 = c1 + 1.0f;
|
||||
return 1.0f + c3 * (float)Math.Pow(value - 1.0f, 3.0f) + c1 * (float)Math.Pow(value - 1.0f, 2.0f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace SHADE_Scripting.UI
|
|||
|
||||
protected override void start()
|
||||
{
|
||||
thread = TweenManager.CreateTweenThread(0.1f, 0.9f, 1.0f, EASING_METHOD.EASE_OUT_BACK);
|
||||
thread = TweenManager.CreateTweenThread(0.1f, 0.9f, 1.0f, EASING_METHOD.EASE_IN_SINE);
|
||||
|
||||
|
||||
Transform transform = GetComponent<Transform>();
|
||||
|
|
|
@ -5,43 +5,43 @@ using SHADE_Scripting.UI;
|
|||
|
||||
public class ChangeSceneButton : Script
|
||||
{
|
||||
public uint sceneID = 0;
|
||||
public uint sceneID = 0;
|
||||
|
||||
public GameObject levelTransistion;
|
||||
//Whether the scene changing button has been clicked
|
||||
private bool clickedFlag;
|
||||
|
||||
private bool clickedFlag;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
clickedFlag = false;
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
UIElement ui = GetComponent<UIElement>();
|
||||
if (ui != null)
|
||||
protected override void awake()
|
||||
{
|
||||
ui.OnRelease.RegisterAction(() =>
|
||||
{
|
||||
if (sceneID != 0)
|
||||
clickedFlag = false;
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
UIElement ui = GetComponent<UIElement>();
|
||||
if (ui != null)
|
||||
{
|
||||
Audio.PlaySFXOnce2D("event:/UI/success");
|
||||
Audio.StopAllSounds();
|
||||
clickedFlag = true;
|
||||
levelTransistion.SetActive(true);
|
||||
ui.OnRelease.RegisterAction(() =>
|
||||
{
|
||||
if (sceneID != 0)
|
||||
{
|
||||
Audio.PlaySFXOnce2D("event:/UI/success");
|
||||
Audio.StopAllSounds();
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
clickedFlag = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Failed to register button action for ChangeSceneButton.");
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
protected override void update()
|
||||
{
|
||||
Debug.LogError("Failed to register button action for ChangeSceneButton.");
|
||||
if (clickedFlag && sceneID != 0 && SceneFadeInOut.Instance.FadeInFinished())
|
||||
{
|
||||
SceneManager.ChangeScene(sceneID);
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void update()
|
||||
{
|
||||
if (levelTransistion.GetScript<LevelTransistion>().complete && clickedFlag)
|
||||
{
|
||||
SceneManager.ChangeScene(sceneID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,9 +54,6 @@ public class CutsceneEnd : Script
|
|||
private bool cutscene4Done = false;
|
||||
private bool cutscene5Done = false;
|
||||
|
||||
public GameObject levelTransition;
|
||||
private bool waiting = false;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
initCutscene4();
|
||||
|
@ -76,9 +73,6 @@ public class CutsceneEnd : Script
|
|||
|
||||
protected override void update()
|
||||
{
|
||||
if (!levelTransition.GetScript<LevelTransistion>().complete)
|
||||
return;
|
||||
|
||||
Canvas4();
|
||||
Canvas5();
|
||||
|
||||
|
@ -104,12 +98,8 @@ public class CutsceneEnd : Script
|
|||
|
||||
if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene5Done && canvas5.IsActiveSelf)
|
||||
{
|
||||
levelTransition.GetScript<LevelTransistion>().resetToLeft();
|
||||
waiting = true;
|
||||
}
|
||||
|
||||
if (levelTransition.GetScript<LevelTransistion>().complete && waiting)
|
||||
SceneManager.ChangeScene(nextScene);
|
||||
}
|
||||
}
|
||||
|
||||
private void Canvas4()
|
||||
|
|
|
@ -82,9 +82,6 @@ public class CutsceneIntro : Script
|
|||
private bool cutscene2Done = false;
|
||||
private bool cutscene3Done = false;
|
||||
|
||||
public GameObject levelTransition;
|
||||
private bool waiting = false;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
initCutscene1();
|
||||
|
@ -112,9 +109,6 @@ public class CutsceneIntro : Script
|
|||
|
||||
protected override void update()
|
||||
{
|
||||
if (!levelTransition.GetScript<LevelTransistion>().complete)
|
||||
return;
|
||||
|
||||
Canvas1();
|
||||
Canvas2();
|
||||
Canvas3();
|
||||
|
@ -154,12 +148,8 @@ public class CutsceneIntro : Script
|
|||
|
||||
if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene3Done && canvas3.IsActiveSelf)
|
||||
{
|
||||
levelTransition.GetScript<LevelTransistion>().resetToLeft();
|
||||
waiting = true;
|
||||
}
|
||||
|
||||
if (levelTransition.GetScript<LevelTransistion>().complete && waiting)
|
||||
SceneManager.ChangeScene(nextScene);
|
||||
}
|
||||
}
|
||||
|
||||
private void Canvas1()
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SHADE;
|
||||
|
||||
namespace SHADE_Scripting.UI
|
||||
{
|
||||
public class GameTimer: Script
|
||||
{
|
||||
private ScaleBounce scaleBounce;
|
||||
private TextRenderable text;
|
||||
public float criticalTime = 30;
|
||||
|
||||
public float timer;
|
||||
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
text = GetComponent<TextRenderable>();
|
||||
if(!text)
|
||||
{
|
||||
Debug.Log("GameTimer: No text renderable found");
|
||||
}
|
||||
|
||||
scaleBounce = GetScript<ScaleBounce>();
|
||||
if(!scaleBounce)
|
||||
{
|
||||
Debug.Log("GameTimer: No Scalebounce found in children");
|
||||
}
|
||||
else
|
||||
{
|
||||
scaleBounce.isActive = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
timer = GameManager.Instance.timer;
|
||||
|
||||
if (timer <= criticalTime)
|
||||
{
|
||||
scaleBounce.isActive = true;
|
||||
text.TextColor = new Color(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Name: SC_GameTimer
|
||||
ID: 158823052
|
||||
Type: 9
|
|
@ -1,91 +0,0 @@
|
|||
using SHADE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
public class LevelTransistion : Script
|
||||
{
|
||||
|
||||
public GameObject logo;
|
||||
public GameObject bg;
|
||||
public float duration = 2.0f;
|
||||
public float bgEndPositionX = 2500;
|
||||
public float logoEndPositionX = 2500;
|
||||
|
||||
public bool rotAndScale = true;
|
||||
public float rotationAmt = 360;
|
||||
public float scaleAmt = 631;
|
||||
|
||||
public bool complete { get; set; }
|
||||
|
||||
private Transform logoTran;
|
||||
private Transform bgTran;
|
||||
|
||||
private TweenThread bgTween;
|
||||
private TweenThread logoTween;
|
||||
private TweenThread rot;
|
||||
private TweenThread scale;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
logoTran = logo.GetComponent<Transform>();
|
||||
if (!logoTran)
|
||||
Debug.LogError("MISSING LOGO TRAN");
|
||||
|
||||
bgTran = bg.GetComponent<Transform>();
|
||||
if (!bgTran)
|
||||
Debug.LogError("MISSING BG TRAN");
|
||||
|
||||
complete = false;
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
bgTween = TweenManager.CreateTweenThread(duration, bgTran.LocalPosition.x, bgEndPositionX, EASING_METHOD.EASE_OUT_CIRCLE);
|
||||
logoTween = TweenManager.CreateTweenThread(duration , logoTran.LocalPosition.x, logoEndPositionX, EASING_METHOD.EASE_OUT_CIRCLE);
|
||||
rot = TweenManager.CreateTweenThread(duration , 0, rotationAmt, EASING_METHOD.EASE_OUT_BACK);
|
||||
scale = TweenManager.CreateTweenThread(duration, 0, scaleAmt, EASING_METHOD.EASE_OUT_BACK);
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if (bgTween != null)
|
||||
bgTran.LocalPosition = new Vector3(bgTween.GetValue(), 0, bgTran.LocalPosition.z);
|
||||
|
||||
if (rotAndScale)
|
||||
{
|
||||
logoTran.LocalScale = new Vector3(scale.GetValue(), scale.GetValue(), 1);
|
||||
logoTran.LocalEulerAngles = new Vector3(0, 0, SHADE.Math.DegreesToRadians(rot.GetValue()));
|
||||
}
|
||||
else
|
||||
{
|
||||
logoTran.LocalPosition = new Vector3(logoTween.GetValue(), 0, logoTran.LocalPosition.z);
|
||||
}
|
||||
|
||||
if (bgTween.IsCompleted() && logoTween.IsCompleted())
|
||||
complete = true;
|
||||
}
|
||||
|
||||
public void resetToLeft()
|
||||
{
|
||||
logoTran.LocalEulerAngles = Vector3.Zero;
|
||||
logoTran.LocalPosition = Vector3.Zero;
|
||||
logoTran.LocalScale = Vector3.Zero;
|
||||
bgTween.duration = 0.8f;
|
||||
bgTween.Reset(-3000.0f,0.0f);
|
||||
logoTween.duration = 0.8f;
|
||||
logoTween.Reset();
|
||||
rot.duration = 0.8f;
|
||||
rot.Reset();
|
||||
scale.duration = 0.8f;
|
||||
scale.Reset();
|
||||
complete = false;
|
||||
rotAndScale = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Name: SC_LevelTransistion
|
||||
ID: 158044875
|
||||
Type: 9
|
|
@ -26,8 +26,7 @@ public class MainMenu : Script
|
|||
{
|
||||
Input.SetMouseCentering(false);
|
||||
Application.IsCursorVisible = true;
|
||||
if(SceneFadeInOut.Instance)
|
||||
SceneFadeInOut.Instance.CallFadeOut();
|
||||
SceneFadeInOut.Instance.CallFadeOut();
|
||||
}
|
||||
protected override void update()
|
||||
{
|
||||
|
|
|
@ -3,7 +3,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SHADE_Scripting.UI
|
||||
|
@ -13,70 +12,98 @@ namespace SHADE_Scripting.UI
|
|||
[NonSerialized]
|
||||
private TweenThread sizeThread;
|
||||
private TweenThread sizeInvertThread;
|
||||
|
||||
private TweenThread alphaThread;
|
||||
|
||||
|
||||
public float maxSize = 1.0f;
|
||||
public float minSize = 0.3f;
|
||||
public float minAlpha = 0.3f;
|
||||
|
||||
|
||||
private bool showMultiplier = false;
|
||||
const float sizeUpDuration = 0.1f;
|
||||
|
||||
[NonSerialized]
|
||||
private Vector3 defaultScale;
|
||||
|
||||
private bool tweenUp = false;
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
sizeThread = TweenManager.CreateTweenThread(0.01f, maxSize, minSize, EASING_METHOD.EASE_IN_SINE);
|
||||
sizeThread = TweenManager.CreateTweenThread(0.0f, maxSize, minSize, EASING_METHOD.EASE_IN_SINE);
|
||||
sizeInvertThread = TweenManager.CreateTweenThread(sizeUpDuration, minSize, maxSize, EASING_METHOD.EASE_IN_SINE);
|
||||
|
||||
alphaThread = TweenManager.CreateTweenThread(0.0f, 1.0f, minAlpha, EASING_METHOD.EASE_OUT_SINE);
|
||||
Transform transform = GetComponent<Transform>();
|
||||
if (transform != null)
|
||||
{
|
||||
defaultScale = transform.LocalScale;
|
||||
transform.LocalScale = Vector3.Zero;
|
||||
}
|
||||
|
||||
|
||||
showMultiplier = false;
|
||||
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
|
||||
if (sizeThread == null || sizeInvertThread == null)
|
||||
return;
|
||||
|
||||
Transform transform = GetComponent<Transform>();
|
||||
|
||||
GetComponent<TextRenderable>().Text = $"X {GameManager.Instance.currMultiplierCombo}";
|
||||
|
||||
if (transform != null)
|
||||
{
|
||||
if (tweenUp == false)
|
||||
protected override void update()
|
||||
{
|
||||
transform.LocalScale = defaultScale * sizeThread.GetValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sizeInvertThread.IsCompleted())
|
||||
{
|
||||
tweenUp = false;
|
||||
sizeThread.Reset();
|
||||
}
|
||||
Transform transform = GetComponent<Transform>();
|
||||
|
||||
|
||||
transform.LocalScale = defaultScale * sizeInvertThread.GetValue();
|
||||
if (transform != null && showMultiplier == true)
|
||||
{
|
||||
if(!sizeInvertThread.IsCompleted())
|
||||
{
|
||||
transform.LocalScale = defaultScale * sizeInvertThread.GetValue();
|
||||
|
||||
Renderable rend = GetComponentInChildren<Renderable>();
|
||||
if(rend)
|
||||
{
|
||||
rend.Material.SetProperty<float>("data.alpha", 1.0f);
|
||||
}
|
||||
|
||||
TextRenderable text = GetComponent<TextRenderable>();
|
||||
if (text)
|
||||
{
|
||||
Color clr = text.TextColor;
|
||||
text.TextColor = new Color(clr.r, clr.g, clr.b, 1.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(sizeThread.IsCompleted())
|
||||
{
|
||||
transform.LocalScale = Vector3.Zero;
|
||||
showMultiplier = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.LocalScale = defaultScale * sizeThread.GetValue();
|
||||
|
||||
Renderable rend = GetComponentInChildren<Renderable>();
|
||||
if (rend)
|
||||
{
|
||||
rend.Material.SetProperty<float>("data.alpha", alphaThread.GetValue());
|
||||
}
|
||||
TextRenderable text = GetComponent<TextRenderable>();
|
||||
if(text)
|
||||
{
|
||||
Color clr = text.TextColor;
|
||||
text.TextColor = new Color(clr.r,clr.g,clr.b,alphaThread.GetValue() * 1.3f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ShowMultiplier(int multiplier, float duration)
|
||||
{
|
||||
GetComponent<TextRenderable>().Text = $"X {multiplier}";
|
||||
sizeThread.duration = duration + sizeUpDuration;
|
||||
alphaThread.duration = duration + sizeUpDuration;
|
||||
|
||||
sizeInvertThread.Reset();
|
||||
sizeThread.Reset();
|
||||
tweenUp = true;
|
||||
alphaThread.Reset();
|
||||
showMultiplier = true;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,111 +0,0 @@
|
|||
using SHADE;
|
||||
using SHADE_Scripting.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
public class Results : Script
|
||||
{
|
||||
public GameObject score;
|
||||
public GameObject timeLeft;
|
||||
public GameObject maxCombo;
|
||||
public GameObject finalScore;
|
||||
public GameObject contiuneBtn;
|
||||
public GameObject levelTransition;
|
||||
public uint nextScene;
|
||||
public float scoreTweenDur = 2.0f;
|
||||
|
||||
private TextRenderable scoreText;
|
||||
private TextRenderable timeLeftText;
|
||||
private TextRenderable maxComboText;
|
||||
private TextRenderable finalScoreText;
|
||||
|
||||
private int scoreCount = 0;
|
||||
private bool once = true;
|
||||
|
||||
[NonSerialized]
|
||||
private TweenThread scoreTween;
|
||||
|
||||
private bool waitForTransition;
|
||||
protected override void awake()
|
||||
{
|
||||
scoreText = score.GetComponent<TextRenderable>();
|
||||
if (!scoreText)
|
||||
Debug.LogError("MISSING SCORE TEXT");
|
||||
|
||||
timeLeftText = timeLeft.GetComponent<TextRenderable>();
|
||||
if (!timeLeftText)
|
||||
Debug.LogError("MISSING TIME LEFT TEXT");
|
||||
|
||||
maxComboText = maxCombo.GetComponent<TextRenderable>();
|
||||
if (!maxComboText)
|
||||
Debug.LogError("MISSING MAX COMBO TEXT");
|
||||
|
||||
finalScoreText = finalScore.GetComponent<TextRenderable>();
|
||||
if (!finalScoreText)
|
||||
Debug.LogError("MISSING FINAL SCORE TEXT");
|
||||
|
||||
if (!contiuneBtn)
|
||||
Debug.LogError("MISSING CONTIUNE BTN");
|
||||
else
|
||||
contiuneBtn.SetActive(false);
|
||||
|
||||
waitForTransition = false;
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
scoreCount = GameManager.Instance.Score + (GameManager.Instance.finalTime * 100);
|
||||
|
||||
if(scoreText)
|
||||
scoreText.Text = $"{GameManager.Instance.Score}";
|
||||
if (timeLeftText)
|
||||
timeLeftText.Text = $"{GameManager.Instance.finalTime}s";
|
||||
if (maxComboText)
|
||||
maxComboText.Text = $"X{GameManager.Instance.MaxComboAccquired}";
|
||||
if (finalScoreText)
|
||||
finalScoreText.Text = $"{scoreCount}";
|
||||
|
||||
UIElement contiune = contiuneBtn.GetComponent<UIElement>();
|
||||
if (contiune != null)
|
||||
{
|
||||
contiune.OnRelease.RegisterAction(() =>
|
||||
{
|
||||
levelTransition.GetScript<LevelTransistion>().resetToLeft();
|
||||
waitForTransition = true;
|
||||
|
||||
GameManager.Instance.GamePause = false;
|
||||
Application.FixDeltaTime = Time.DefaultFixDeltaTime;
|
||||
AnimationSystem.TimeScale = AnimationSystem.DefaultTimeScale;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Failed to register contiune button.");
|
||||
}
|
||||
|
||||
scoreTween = TweenManager.CreateTweenThread(scoreTweenDur, 0, scoreCount, EASING_METHOD.EASE_IN_SINE);
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if (levelTransition.GetScript<LevelTransistion>().complete && waitForTransition)
|
||||
{
|
||||
Audio.StopAllSounds();
|
||||
SceneManager.ChangeScene(nextScene);
|
||||
}
|
||||
|
||||
if (finalScoreText && !scoreTween.IsCompleted())
|
||||
finalScoreText.Text = $"{(int)scoreTween.GetValue()}";
|
||||
else if(scoreTween.IsCompleted() && once)
|
||||
{
|
||||
contiuneBtn.SetActive(true);
|
||||
finalScoreText.Text = $"{scoreCount}";
|
||||
once = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Name: SC_Results
|
||||
ID: 154482040
|
||||
Type: 9
|
|
@ -1,4 +1,4 @@
|
|||
using SHADE;
|
||||
using SHADE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -7,55 +7,41 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace SHADE_Scripting.UI
|
||||
{
|
||||
public class ScaleBounce : Script
|
||||
{
|
||||
[NonSerialized]
|
||||
private TweenThread thread;
|
||||
|
||||
public float minScale = 1.0f;
|
||||
public float maxScale = 1.2f;
|
||||
public float duration = 1.0f;
|
||||
|
||||
private Vector3 defaultScale;
|
||||
|
||||
|
||||
public bool isActive = false;
|
||||
|
||||
private bool lastActive = false;
|
||||
|
||||
protected override void start()
|
||||
public class ScaleBounce:Script
|
||||
{
|
||||
thread = TweenManager.CreateTweenThread(duration, minScale, maxScale, EASING_METHOD.EASE_IN_SINE);
|
||||
Transform trans = GetComponent<Transform>();
|
||||
if (trans != null)
|
||||
{
|
||||
defaultScale = trans.LocalScale;
|
||||
}
|
||||
[NonSerialized]
|
||||
private TweenThread thread;
|
||||
|
||||
public float minScale = 1.0f;
|
||||
public float maxScale = 1.2f;
|
||||
public float duration = 1.0f;
|
||||
|
||||
private Vector3 defaultScale;
|
||||
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
thread = TweenManager.CreateTweenThread(duration, minScale, maxScale, EASING_METHOD.EASE_IN_SINE);
|
||||
Transform trans = GetComponent<Transform>();
|
||||
if(trans != null)
|
||||
{
|
||||
defaultScale = trans.LocalScale;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
Transform trans = GetComponent<Transform>();
|
||||
if(trans != null)
|
||||
{
|
||||
trans.LocalScale = defaultScale * thread.GetValue();
|
||||
}
|
||||
if(thread.IsCompleted())
|
||||
{
|
||||
thread.ResetInvert();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
|
||||
if (thread == null)
|
||||
return;
|
||||
|
||||
if (isActive != lastActive && isActive == true)
|
||||
{
|
||||
thread.Reset();
|
||||
}
|
||||
lastActive = isActive;
|
||||
|
||||
Transform trans = GetComponent<Transform>();
|
||||
if (trans != null && isActive)
|
||||
{
|
||||
trans.LocalScale = defaultScale * thread.GetValue();
|
||||
}
|
||||
if (thread.IsCompleted())
|
||||
{
|
||||
thread.ResetInvert();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,43 +7,44 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace SHADE_Scripting.UI
|
||||
{
|
||||
public class ScrollingCredits : Script
|
||||
{
|
||||
|
||||
public float endY = 4000.0f;
|
||||
public float duration = 30.0f;
|
||||
public GameObject levelTransition;
|
||||
|
||||
|
||||
[NonSerialized]
|
||||
TweenThread thread;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
base.awake();
|
||||
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
public class ScrollingCredits: Script
|
||||
{
|
||||
|
||||
Transform transform = GetComponent<Transform>();
|
||||
if (transform != null)
|
||||
{
|
||||
thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.LINEAR);
|
||||
thread.SetResetOnInactive(GameObject);
|
||||
}
|
||||
public float endY = 4000.0f;
|
||||
public float duration = 30.0f;
|
||||
|
||||
|
||||
[NonSerialized]
|
||||
TweenThread thread;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
base.awake();
|
||||
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
base.start();
|
||||
|
||||
Transform transform = GetComponent<Transform>();
|
||||
if(transform != null)
|
||||
{
|
||||
thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.LINEAR);
|
||||
thread.SetResetOnInactive(GameObject);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
base.update();
|
||||
|
||||
Transform transform = GetComponent<Transform>();
|
||||
|
||||
if(thread != null && transform != null)
|
||||
{
|
||||
transform.LocalPosition = new Vector3( transform.LocalPosition.x ,thread.GetValue() , transform.LocalPosition.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
|
||||
Transform transform = GetComponent<Transform>();
|
||||
|
||||
if (thread != null && transform != null)
|
||||
{
|
||||
transform.LocalPosition = new Vector3(transform.LocalPosition.x, thread.GetValue(), transform.LocalPosition.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,73 +7,67 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace SHADE_Scripting.UI
|
||||
{
|
||||
public class SingleScaleBounce : Script
|
||||
{
|
||||
[NonSerialized]
|
||||
TweenThread thread;
|
||||
|
||||
[NonSerialized]
|
||||
Vector3 defaultScale;
|
||||
|
||||
public float durationUp = 0.15f;
|
||||
public float durationDown = 0.3f;
|
||||
|
||||
public float scaleSize = 1.2f;
|
||||
|
||||
[NonSerialized]
|
||||
private bool scaleUp = false;
|
||||
|
||||
private Transform trans;
|
||||
|
||||
protected override void awake()
|
||||
public class SingleScaleBounce: Script
|
||||
{
|
||||
trans = GetComponent<Transform>();
|
||||
if (trans != null)
|
||||
{
|
||||
defaultScale = trans.LocalScale;
|
||||
}
|
||||
[NonSerialized]
|
||||
TweenThread thread;
|
||||
|
||||
}
|
||||
[NonSerialized]
|
||||
Vector3 defaultScale;
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
|
||||
thread = TweenManager.CreateTweenThread(0.0f, 1.0f, 1.0f, EASING_METHOD.LINEAR);
|
||||
}
|
||||
public float durationUp = 0.15f;
|
||||
public float durationDown = 0.3f;
|
||||
|
||||
public float scaleSize = 1.2f;
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if (scaleUp)
|
||||
{
|
||||
if (thread != null && thread.IsCompleted())
|
||||
[NonSerialized]
|
||||
private bool scaleUp = false;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
scaleUp = false;
|
||||
thread.duration = durationDown;
|
||||
thread.method = EASING_METHOD.LINEAR;
|
||||
thread.ResetInvert();
|
||||
Transform trans = GetComponent<Transform>();
|
||||
if(trans != null)
|
||||
{
|
||||
defaultScale = trans.LocalScale;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (trans && thread != null)
|
||||
trans.LocalScale = defaultScale * thread.GetValue();
|
||||
protected override void start()
|
||||
{
|
||||
thread = TweenManager.CreateTweenThread(0.0f,1.0f,1.0f,EASING_METHOD.EASE_IN_SINE);
|
||||
}
|
||||
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if(scaleUp)
|
||||
{
|
||||
if(thread.IsCompleted())
|
||||
{
|
||||
scaleUp = false;
|
||||
thread.duration = durationDown;
|
||||
thread.ResetInvert();
|
||||
}
|
||||
}
|
||||
|
||||
Transform trans = GetComponent<Transform>();
|
||||
if(trans != null)
|
||||
{
|
||||
trans.LocalScale = defaultScale * thread.GetValue();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void ScaleBounceOnce()
|
||||
{
|
||||
scaleUp = true;
|
||||
thread.duration = durationUp;
|
||||
thread.Reset(1.0f, scaleSize);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void ScaleBounceOnce()
|
||||
{
|
||||
scaleUp = true;
|
||||
if (thread != null)
|
||||
{
|
||||
thread.duration = durationUp;
|
||||
thread.Reset(1.0f, scaleSize);
|
||||
thread.method = EASING_METHOD.EASE_OUT_BACK;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Single Scale Bounce: thread is null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
using SHADE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SHADE_Scripting.UI
|
||||
{
|
||||
public class SliderFX : Script
|
||||
{
|
||||
|
||||
public string onClickSound = "event:/UI/button_success";
|
||||
public string onReleaseSound = "event:/UI/button_fail";
|
||||
|
||||
|
||||
[NonSerialized]
|
||||
private AudioClipHandler onClickACHandler;
|
||||
[NonSerialized]
|
||||
private AudioClipHandler onReleaseACHandler;
|
||||
|
||||
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
|
||||
|
||||
if (onClickSound != "Empty")
|
||||
onClickACHandler = SHADE.Audio.CreateAudioClip(onClickSound);
|
||||
if (onReleaseSound != "Empty")
|
||||
onReleaseACHandler = SHADE.Audio.CreateAudioClip(onReleaseSound);
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
|
||||
|
||||
Transform transform = GetComponent<Transform>();
|
||||
if (transform == null)
|
||||
return;
|
||||
|
||||
UIElement ui = GetComponent<UIElement>();
|
||||
if (ui == null)
|
||||
return;
|
||||
|
||||
|
||||
ui.OnClick.RegisterAction(() =>
|
||||
{
|
||||
if (onClickSound != "Empty")
|
||||
onClickACHandler.Play();
|
||||
|
||||
});
|
||||
|
||||
ui.OnRelease.RegisterAction(() =>
|
||||
{
|
||||
if (onReleaseSound != "Empty")
|
||||
onReleaseACHandler.Play();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Name: SC_SliderFX
|
||||
ID: 157251414
|
||||
Type: 9
|
|
@ -35,9 +35,9 @@ public class StealFoodPopUp : Script
|
|||
|
||||
protected override void start()
|
||||
{
|
||||
rot = TweenManager.CreateTweenThread(popInDuration * 0.4f, 0, rotationAmt, EASING_METHOD.LINEAR);
|
||||
scaleX = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtX, EASING_METHOD.EASE_OUT_BACK);
|
||||
scaleY = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtY, EASING_METHOD.EASE_OUT_BACK);
|
||||
rot = TweenManager.CreateTweenThread(popInDuration, 0, rotationAmt, EASING_METHOD.EASE_IN_SINE);
|
||||
scaleX = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtX, EASING_METHOD.EASE_IN_SINE);
|
||||
scaleY = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtY, EASING_METHOD.EASE_IN_SINE);
|
||||
|
||||
tran = GetComponent<Transform>();
|
||||
if (!tran)
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SHADE;
|
||||
|
||||
namespace SHADE_Scripting.UI
|
||||
{
|
||||
public class TransitToMainMenu: Script
|
||||
{
|
||||
public float timeToTransit = 0.0f;
|
||||
public uint sceneToChange = 0;
|
||||
private float timer = 0.0f;
|
||||
private bool sceneChanged = false;
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
timer = timeToTransit;
|
||||
sceneChanged = false;
|
||||
}
|
||||
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
timer -= Time.DeltaTimeF;
|
||||
if(timer <= 0.0f && sceneChanged == false)
|
||||
{
|
||||
SceneManager.ChangeScene(sceneToChange);
|
||||
sceneChanged = true;
|
||||
}
|
||||
if(Input.GetKeyDown(Input.KeyCode.Space))
|
||||
{
|
||||
timer = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Name: TransitToMainMenu
|
||||
ID: 159865134
|
||||
Type: 9
|
Binary file not shown.
|
@ -14,8 +14,6 @@ struct EmitterParameters
|
|||
float rotationDecay;
|
||||
vec4 lifeAndSizeRange; // min life, max life, min size, max size
|
||||
vec4 colorTint;
|
||||
vec4 colorTintRange;
|
||||
vec4 colorDecay;
|
||||
float sizeDecay;
|
||||
uint textureIndex;
|
||||
float padding[2];
|
||||
|
@ -29,7 +27,6 @@ struct ParticleData
|
|||
vec4 acceleration;
|
||||
vec4 scaleAndDecay;
|
||||
vec4 colorTint;
|
||||
vec4 colorDecay;
|
||||
float life;
|
||||
uint textureIndex;
|
||||
};
|
||||
|
@ -178,18 +175,9 @@ void main()
|
|||
particle.scaleAndDecay.y = particleSize;
|
||||
particle.scaleAndDecay.z = emitterParams.data.sizeDecay;
|
||||
particle.scaleAndDecay.w = emitterParams.data.sizeDecay;
|
||||
particle.colorDecay = emitterParams.data.colorDecay;
|
||||
|
||||
float randRange = rand(seed) * 2.0f - 1.0f;
|
||||
|
||||
// Set particle color tint
|
||||
particle.colorTint = emitterParams.data.colorTint + vec4 (randRange * emitterParams.data.colorTintRange.x,
|
||||
randRange * emitterParams.data.colorTintRange.y,
|
||||
randRange * emitterParams.data.colorTintRange.z,
|
||||
randRange * emitterParams.data.colorTintRange.w);
|
||||
|
||||
// particle.colorTint = emitterParams.data.colorTint;
|
||||
|
||||
particle.colorTint = emitterParams.data.colorTint;
|
||||
|
||||
// Set the texture for the particle
|
||||
particle.textureIndex = emitterParams.data.textureIndex;
|
||||
|
|
Binary file not shown.
|
@ -1,27 +0,0 @@
|
|||
#version 460 core
|
||||
#extension GL_EXT_nonuniform_qualifier : require
|
||||
|
||||
layout (location = 0) out vec4 fragColor;
|
||||
|
||||
layout (set = 0, binding = 1) uniform sampler2D textures[]; // for textures (global)
|
||||
|
||||
// between shader stages
|
||||
layout(location = 0) in struct
|
||||
{
|
||||
vec2 uv; // location = 0
|
||||
} In;
|
||||
|
||||
// material stuff
|
||||
layout(location = 1) flat in struct
|
||||
{
|
||||
uint textureIndex;
|
||||
vec4 color;
|
||||
} InFlat;
|
||||
|
||||
void main ()
|
||||
{
|
||||
fragColor = vec4 (texture(textures [nonuniformEXT(InFlat.textureIndex)], In.uv)) * InFlat.color;
|
||||
|
||||
if (fragColor.a < 0.01f)
|
||||
discard;
|
||||
}
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
Name: ParticleRounded_FS
|
||||
ID: 42315398
|
||||
Type: 2
|
|
@ -1,107 +0,0 @@
|
|||
#version 460 core
|
||||
|
||||
struct GenericData
|
||||
{
|
||||
//! Delta time
|
||||
float dt;
|
||||
|
||||
//! Elapsed time of the application
|
||||
float elapsedTime;
|
||||
|
||||
//! Viewport width of the scene (excluding imgui, that means smaller than window)
|
||||
uint viewportWidth;
|
||||
|
||||
//! Ditto but for height
|
||||
uint viewportHeight;
|
||||
};
|
||||
|
||||
struct ParticleData
|
||||
{
|
||||
vec4 position;
|
||||
vec4 orientationSpeedDecay;
|
||||
vec4 velocity;
|
||||
vec4 acceleration;
|
||||
vec4 scaleAndDecay;
|
||||
vec4 colorTint;
|
||||
vec4 colorDecay;
|
||||
float life;
|
||||
uint textureIndex;
|
||||
};
|
||||
|
||||
layout (set = 0, binding = 0) uniform GenericDataBuffer
|
||||
{
|
||||
GenericData data;
|
||||
} genericDataBuffer;
|
||||
|
||||
|
||||
layout(set = 1, binding = 0) uniform CameraData
|
||||
{
|
||||
vec4 position;
|
||||
mat4 vpMat;
|
||||
mat4 viewMat;
|
||||
mat4 projMat;
|
||||
} cameraData;
|
||||
|
||||
// output buffer not needed
|
||||
layout (std430, set = 2, binding = 2) coherent restrict buffer ParticlesOutputBuffer
|
||||
{
|
||||
ParticleData data[];
|
||||
} outputParticles;
|
||||
|
||||
layout (std430, set = 2, binding = 4) coherent restrict buffer IndicesData
|
||||
{
|
||||
uint indices[];
|
||||
};
|
||||
|
||||
// between shader stages
|
||||
layout(location = 0) out struct
|
||||
{
|
||||
vec2 uv; // location = 0
|
||||
} Out;
|
||||
|
||||
// material stuff
|
||||
layout(location = 1) out struct
|
||||
{
|
||||
uint textureIndex; // location = 1
|
||||
vec4 color; // location = 2
|
||||
} OutFlat;
|
||||
|
||||
vec2 CreateQuad (in uint vertexID)
|
||||
{
|
||||
uint b = 1 << vertexID;
|
||||
return vec2 ((0x3 & b) != 0, (0x9 & b) != 0);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// Create a quad and its texture coordinates
|
||||
Out.uv = CreateQuad (gl_VertexIndex);
|
||||
vec3 vertexPos = vec3 (Out.uv - vec2(0.5f), 0.0f);
|
||||
vertexPos.y *= 0.5f;
|
||||
|
||||
ParticleData particle = outputParticles.data[indices[gl_InstanceIndex]];
|
||||
|
||||
vec3 normalized = normalize (vec3 (particle.velocity.xyz));
|
||||
float pitch = acos (dot (normalized.xyz, normalize (vec3 (normalized.x, 0.0f, normalized.z))));
|
||||
|
||||
float angle = pitch;
|
||||
// float angle = atan (normalized.y, normalized.x);
|
||||
vec2 particleScaleData = particle.scaleAndDecay.xy; // x and y
|
||||
|
||||
mat3 rotate = mat3 (1.0f);
|
||||
rotate[0][0] = cos(angle);
|
||||
rotate[0][1] = sin(angle);
|
||||
rotate[1][0] = -sin(angle);
|
||||
rotate[1][1] = cos(angle);
|
||||
|
||||
vec3 particlePos = rotate * vertexPos;
|
||||
|
||||
vec3 viewRight = normalize (vec3 (cameraData.viewMat[0][0], cameraData.viewMat[1][0], cameraData.viewMat[2][0]));
|
||||
vec3 viewUp = normalize(vec3 (cameraData.viewMat[0][1], cameraData.viewMat[1][1], cameraData.viewMat[2][1]));
|
||||
|
||||
particlePos = particle.position.xyz + (viewRight * particlePos.x * particleScaleData.x) + (viewUp * particlePos.y * particleScaleData.y);
|
||||
OutFlat.textureIndex = particle.textureIndex;
|
||||
OutFlat.color = particle.colorTint;
|
||||
|
||||
gl_Position = cameraData.vpMat * vec4(particlePos, 1.0f);
|
||||
}
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
Name: ParticleRounded_VS
|
||||
ID: 44202416
|
||||
Type: 2
|
|
@ -18,7 +18,6 @@ struct ParticleData
|
|||
vec4 acceleration;
|
||||
vec4 scaleAndDecay;
|
||||
vec4 colorTint;
|
||||
vec4 colorDecay;
|
||||
float life;
|
||||
uint textureIndex;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -17,8 +17,6 @@ struct ParticleData
|
|||
vec4 velocity;
|
||||
vec4 acceleration;
|
||||
vec4 scaleAndDecay;
|
||||
vec4 colorTint;
|
||||
vec4 colorDecay;
|
||||
float life;
|
||||
uint textureIndex;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -18,7 +18,6 @@ struct ParticleData
|
|||
vec4 acceleration;
|
||||
vec4 scaleAndDecay;
|
||||
vec4 colorTint;
|
||||
vec4 colorDecay;
|
||||
float life;
|
||||
uint textureIndex;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -18,7 +18,6 @@ struct ParticleData
|
|||
vec4 acceleration;
|
||||
vec4 scaleAndDecay;
|
||||
vec4 colorTint;
|
||||
vec4 colorDecay;
|
||||
float life;
|
||||
uint textureIndex;
|
||||
};
|
||||
|
@ -127,7 +126,6 @@ void main()
|
|||
particle.orientationSpeedDecay.x += particle.orientationSpeedDecay.y;
|
||||
particle.scaleAndDecay.x *= particle.scaleAndDecay.z;
|
||||
particle.scaleAndDecay.y *= particle.scaleAndDecay.w;
|
||||
particle.colorTint -= particle.colorDecay * genericDataBuffer.data.dt;
|
||||
|
||||
if (particle.orientationSpeedDecay.y > 0.0f)
|
||||
{
|
||||
|
|
Binary file not shown.
|
@ -15,6 +15,7 @@ struct GenericData
|
|||
uint viewportHeight;
|
||||
};
|
||||
|
||||
|
||||
struct ParticleData
|
||||
{
|
||||
vec4 position;
|
||||
|
@ -23,7 +24,6 @@ struct ParticleData
|
|||
vec4 acceleration;
|
||||
vec4 scaleAndDecay;
|
||||
vec4 colorTint;
|
||||
vec4 colorDecay;
|
||||
float life;
|
||||
uint textureIndex;
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -8,7 +8,6 @@ struct MatPropData
|
|||
int textureIndex;
|
||||
float alpha;
|
||||
float sliderThreshold;
|
||||
float borderThickness;
|
||||
vec4 sliderStartColor;
|
||||
vec4 sliderEndColor;
|
||||
vec4 sliderBarColor;
|
||||
|
@ -44,8 +43,6 @@ void main()
|
|||
{
|
||||
//fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
|
||||
|
||||
|
||||
|
||||
if (In.uv.x > MatProp.data[In2.materialIndex].sliderThreshold)
|
||||
fragColor = MatProp.data[In2.materialIndex].sliderBarColor;
|
||||
else
|
||||
|
|
Binary file not shown.
|
@ -42,21 +42,19 @@ layout(location = 1) out uint outEntityID;
|
|||
void main()
|
||||
{
|
||||
//fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
|
||||
fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
|
||||
|
||||
if (In.uv.x > MatProp.data[In2.materialIndex].sliderThreshold)
|
||||
fragColor = MatProp.data[In2.materialIndex].sliderBarColor;
|
||||
else
|
||||
//fragColor = (1.0f - In.uv.x) * MatProp.data[In2.materialIndex].sliderStartColor + In.uv.x * MatProp.data[In2.materialIndex].sliderEndColor;
|
||||
fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
|
||||
|
||||
|
||||
if (fragColor.a < 0.01f)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
if (In.uv.x > MatProp.data[In2.materialIndex].sliderThreshold)
|
||||
fragColor = MatProp.data[In2.materialIndex].sliderBarColor;
|
||||
|
||||
if (fragColor.xyz == vec3(0.0f, 0.0f, 0.0f))
|
||||
fragColor.xyz = MatProp.data[In2.materialIndex].sliderStartColor.xyz;
|
||||
|
||||
|
||||
|
||||
|
||||
fragColor.a = MatProp.data[In2.materialIndex].alpha;
|
||||
|
||||
// fragColor.a = 1.0f;
|
||||
|
|
Binary file not shown.
|
@ -1,41 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
#extension GL_EXT_nonuniform_qualifier : require
|
||||
|
||||
struct MatPropData
|
||||
{
|
||||
int textureIndex;
|
||||
float alpha;
|
||||
};
|
||||
|
||||
layout(location = 0) in struct
|
||||
{
|
||||
vec4 vertPos; // location 0
|
||||
vec2 uv; // location = 1
|
||||
vec4 normal; // location = 2
|
||||
|
||||
} In;
|
||||
|
||||
// material stuff
|
||||
layout(location = 3) flat in struct
|
||||
{
|
||||
int materialIndex;
|
||||
uint eid;
|
||||
uint lightLayerIndex;
|
||||
} In2;
|
||||
|
||||
layout (set = 0, binding = 1) uniform sampler2D textures[]; // for textures (global)
|
||||
layout (std430, set = 2, binding = 0) buffer MaterialProperties // For materials
|
||||
{
|
||||
MatPropData data[];
|
||||
} MatProp;
|
||||
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
layout(location = 1) out uint outEntityID;
|
||||
|
||||
void main()
|
||||
{
|
||||
fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
|
||||
outEntityID = In2.eid;
|
||||
}
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
Name: UI_TRANSISTION_FS
|
||||
ID: 40208610
|
||||
Type: 2
|
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
Name: Score_hover
|
||||
ID: 55195346
|
||||
Type: 3
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue