mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-12 12:25:16 -05:00
Merge branch 'KingAbilities'
This commit is contained in:
@@ -67,8 +67,8 @@ Material:
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _RimAmount: 0.464
|
||||
- _RimThreshold: 0.491
|
||||
- _RimAmount: 0
|
||||
- _RimThreshold: 0
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
|
||||
111
Assets/Prefabs/King/Goo.prefab
Normal file
111
Assets/Prefabs/King/Goo.prefab
Normal file
@@ -0,0 +1,111 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &9109488354154531999
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9109488354154531994}
|
||||
- component: {fileID: 9109488354154531995}
|
||||
- component: {fileID: 9109488354154531992}
|
||||
- component: {fileID: 9109488354154531993}
|
||||
- component: {fileID: 9109488354154531998}
|
||||
m_Layer: 0
|
||||
m_Name: Goo
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &9109488354154531994
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9109488354154531999}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -29.02, y: 0.165, z: -21.09}
|
||||
m_LocalScale: {x: 0.083767, y: 1, z: 0.1153}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &9109488354154531995
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9109488354154531999}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &9109488354154531992
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9109488354154531999}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: b29af44fbd39d454c82a8ddf149c0a9a, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!64 &9109488354154531993
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9109488354154531999}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
m_Convex: 1
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!114 &9109488354154531998
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9109488354154531999}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3b6c921b5d2c15a4cb9e536856c88cf6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
7
Assets/Prefabs/King/Goo.prefab.meta
Normal file
7
Assets/Prefabs/King/Goo.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0a933a7f4d98134ea0c045fabc6a6a0
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
128
Assets/Prefabs/King/Hail.prefab
Normal file
128
Assets/Prefabs/King/Hail.prefab
Normal file
@@ -0,0 +1,128 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3697101767757923800
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4246928924194960466}
|
||||
- component: {fileID: 4504488356822805126}
|
||||
- component: {fileID: 5295847759173883491}
|
||||
- component: {fileID: 5907924033250747256}
|
||||
- component: {fileID: 7867345786326767111}
|
||||
- component: {fileID: 9161762588931088055}
|
||||
m_Layer: 0
|
||||
m_Name: Hail
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4246928924194960466
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697101767757923800}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 21.265, y: 15.767, z: -120.791}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &4504488356822805126
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697101767757923800}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &5295847759173883491
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697101767757923800}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!54 &5907924033250747256
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697101767757923800}
|
||||
serializedVersion: 2
|
||||
m_Mass: 20
|
||||
m_Drag: 0.05
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 1
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 10
|
||||
m_CollisionDetection: 0
|
||||
--- !u!135 &7867345786326767111
|
||||
SphereCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697101767757923800}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Radius: 0.5
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &9161762588931088055
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697101767757923800}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 06bf4238b8275414aa092a505249cb1a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
shadow: {fileID: 2481528670431999298, guid: 27744b51bdd10b246983d369908f08fc, type: 3}
|
||||
7
Assets/Prefabs/King/Hail.prefab.meta
Normal file
7
Assets/Prefabs/King/Hail.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5137ba8741866bd429180e6ae058498a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
83
Assets/Prefabs/King/Shadow.prefab
Normal file
83
Assets/Prefabs/King/Shadow.prefab
Normal file
@@ -0,0 +1,83 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2481528670431999298
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2481528670431999297}
|
||||
- component: {fileID: 2481528670431999296}
|
||||
- component: {fileID: 2481528670431999299}
|
||||
m_Layer: 0
|
||||
m_Name: Shadow
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2481528670431999297
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2481528670431999298}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 7.36, y: 0, z: -111.7}
|
||||
m_LocalScale: {x: 0.25, y: 0, z: 0.25}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &2481528670431999296
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2481528670431999298}
|
||||
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &2481528670431999299
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2481528670431999298}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 730a2ba314caf9742823631b050afe28, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
7
Assets/Prefabs/King/Shadow.prefab.meta
Normal file
7
Assets/Prefabs/King/Shadow.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27744b51bdd10b246983d369908f08fc
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
1951
Assets/Scenes/Demos/KingImp.unity
Normal file
1951
Assets/Scenes/Demos/KingImp.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/Demos/KingImp.unity.meta
Normal file
7
Assets/Scenes/Demos/KingImp.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 953bc06250466264fa90b3719fce2ead
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14595e0094b28384c8078f76053166e3
|
||||
guid: e4d88fa8403c1ff499ee54632066a7ee
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
8
Assets/Scripts/KingScripts.meta
Normal file
8
Assets/Scripts/KingScripts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee3a3f183dfdd2146ba3a25cfa8269b3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/KingScripts/KingAbilities.meta
Normal file
8
Assets/Scripts/KingScripts/KingAbilities.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14595e0094b28384c8078f76053166e3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
34
Assets/Scripts/KingScripts/KingAbilities/Boulder.cs
Normal file
34
Assets/Scripts/KingScripts/KingAbilities/Boulder.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Boulder : MonoBehaviour
|
||||
{
|
||||
private Rigidbody boulder;
|
||||
|
||||
void Start() {
|
||||
boulder = GetComponent<Rigidbody>();//Gets the rigidbody attached to the bolder
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider other) {
|
||||
if (other.tag == "Player") {
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
Vector3 Dir = boulder.velocity;//Finds the bolder's velocity
|
||||
float Power = boulder.velocity.magnitude * 250;//Finds the power of the boulder by using it's velocity and a scaler
|
||||
Dir = Vector3.Normalize(Dir);//Normalizes the vector to be used as a knockback direction
|
||||
player.GetComponent<PlayerMovement>().AddImpact(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed
|
||||
}
|
||||
}
|
||||
|
||||
//Coppied from player for easy Boulder Testing/Demonstration
|
||||
void FixedUpdate() {
|
||||
Respawn();
|
||||
}
|
||||
|
||||
private void Respawn()
|
||||
{
|
||||
if (transform.position.y < -1) {
|
||||
transform.position = new Vector3(74.67f, 34.68f, 7.15f);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingAbilities/Boulder.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingAbilities/Boulder.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 502e1c22be3238645a39762fd220d3b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
26
Assets/Scripts/KingScripts/KingAbilities/Goo.cs
Normal file
26
Assets/Scripts/KingScripts/KingAbilities/Goo.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Goo : MonoBehaviour
|
||||
{
|
||||
int Lifetime = 0;
|
||||
|
||||
void FixedUpdate() {
|
||||
Lifetime++;
|
||||
if(Lifetime == 550) {
|
||||
Destruction();
|
||||
}
|
||||
}
|
||||
|
||||
//Makes the player sliperly whenever they step on the goo
|
||||
void OnTriggerEnter(Collider other) {
|
||||
Debug.Log("Slippy!");
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
player.GetComponent<PlayerStats>().Traction = 1.5f;//Make it slippy
|
||||
}
|
||||
|
||||
void Destruction() {
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingAbilities/Goo.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingAbilities/Goo.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b6c921b5d2c15a4cb9e536856c88cf6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
52
Assets/Scripts/KingScripts/KingAbilities/Hail.cs
Normal file
52
Assets/Scripts/KingScripts/KingAbilities/Hail.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Hail : MonoBehaviour
|
||||
{
|
||||
private Rigidbody hail;
|
||||
public GameObject shadow;
|
||||
|
||||
private float ShadStSz = 0;
|
||||
private float m;
|
||||
private GameObject ShadTemp = null;
|
||||
|
||||
|
||||
void Start() {
|
||||
hail = GetComponent<Rigidbody>();//Gets the rigidbody attached to the bolder
|
||||
|
||||
ShadTemp = Instantiate(shadow);//Creates the shadow
|
||||
ShadTemp.transform.position = new Vector3(hail.transform.position.x, 0, hail.transform.position.z);//Sets it properly directly under the hail
|
||||
ShadTemp.transform.localScale = new Vector3(ShadStSz, 0, ShadStSz);//Scales it to the proper start size
|
||||
m = (hail.transform.localScale.x - ShadStSz) / 30;//Find the proper rate of growth
|
||||
}
|
||||
|
||||
void FixedUpdate() {
|
||||
float y = m * (hail.transform.position.y-30) + ShadStSz;//Find the proper current size
|
||||
ShadTemp.transform.localScale = new Vector3(y, 0, y);//Scales the shadow to that size
|
||||
Destruction();//Sees if it needs to destroy both
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider other) {
|
||||
if (other.tag == "Player") {
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
float Power = hail.velocity.magnitude * 100;//Finds the power of the hail by using it's velocity and a scaler
|
||||
//Find the dirrection of launch by finding the direction between the two points of the player and the Hail
|
||||
float px = player.transform.position.x;
|
||||
float pz = player.transform.position.z;
|
||||
float hx = hail.transform.position.x;
|
||||
float hz = hail.transform.position.z;
|
||||
//Direction pointing away from the center of the Hail
|
||||
Vector3 Dir = new Vector3(px - hx, 0, pz - hz);
|
||||
player.GetComponent<PlayerMovement>().AddImpact(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed
|
||||
}
|
||||
}
|
||||
|
||||
//Destroys the Hail and its shadow
|
||||
void Destruction() {
|
||||
if(hail.transform.position.y <= 0) {
|
||||
Destroy(ShadTemp);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingAbilities/Hail.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingAbilities/Hail.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06bf4238b8275414aa092a505249cb1a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
43
Assets/Scripts/KingScripts/KingAbilities/HailArea.cs
Normal file
43
Assets/Scripts/KingScripts/KingAbilities/HailArea.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class HailArea : MonoBehaviour
|
||||
{
|
||||
// Update is called once per frame
|
||||
public float Xmax = 15f;
|
||||
public float Xmin = -15f;
|
||||
|
||||
public float Zmax = -85f;
|
||||
public float Zmin = -115f;
|
||||
|
||||
public GameObject Hail;
|
||||
|
||||
int timer = 0;
|
||||
// FixedUpdate is called once per .02 seconds (or 50 times a second)
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (timer == 50) {
|
||||
timer = 0;
|
||||
//Random diameter 4->8
|
||||
float diameter = Random.Range(4, 8);
|
||||
float radius = diameter / 2.0f;
|
||||
//Random pos X Xmax-radius -> Xmin+radius
|
||||
//Random pos Z Zmax-radius -> Zmin+radius
|
||||
Vector3 position = new Vector3(Random.Range(Xmin + radius, Xmax - radius), 30, Random.Range(Zmin + radius, Zmax - radius));
|
||||
|
||||
SpawnHail(diameter, position);
|
||||
}
|
||||
timer++;
|
||||
}
|
||||
|
||||
// Spawns a singular Hail piece
|
||||
void SpawnHail(float size, Vector3 pos)
|
||||
{
|
||||
//Spawn HailBall and its shadow
|
||||
GameObject HailTemp = null;
|
||||
HailTemp = Instantiate(Hail);
|
||||
HailTemp.transform.position = pos;
|
||||
HailTemp.transform.localScale = new Vector3(size, size, size);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingAbilities/HailArea.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingAbilities/HailArea.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd71374cb5b4801478a3035abe5bbaf5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
49
Assets/Scripts/KingScripts/KingAbilities/Slime.cs
Normal file
49
Assets/Scripts/KingScripts/KingAbilities/Slime.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Slime : MonoBehaviour
|
||||
{
|
||||
float MoveDir;
|
||||
int GooTimer = 0;
|
||||
Vector3 offset = new Vector3(0.0f, 0.4f, 0.0f);
|
||||
public GameObject Goo;
|
||||
public GameObject Folder;
|
||||
public int StartPos = -29;
|
||||
public int EndPos = -57;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
MoveDir = Time.deltaTime;
|
||||
}
|
||||
|
||||
// FixedUpdate is called once per .02 seconds (or 50 times a second)
|
||||
void FixedUpdate()
|
||||
{
|
||||
//create goo underneath them slime
|
||||
if (GooTimer == 6) {
|
||||
GameObject GooTrail = null;
|
||||
GooTrail = Instantiate(Goo, transform.position - offset, transform.rotation);
|
||||
GooTrail.transform.parent = Folder.transform;
|
||||
GooTimer = 0;
|
||||
}
|
||||
//attempt to move forward (Raycast for objects, how to make sure it didn't fall off a cliff?)
|
||||
if (transform.position.z >= StartPos || transform.position.z <= EndPos) {//Rough way of keeping turning it around when it reaches an end
|
||||
MoveDir = -MoveDir;
|
||||
}
|
||||
//if can't Turn around 180 degrees
|
||||
//otherwise actually move forward
|
||||
transform.Translate(0, 0, MoveDir);
|
||||
GooTimer++;
|
||||
}
|
||||
|
||||
void OnTriggerStay(Collider other) {
|
||||
//slow down player
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
//Get the Player's speed
|
||||
float CurVel = player.GetComponent<PlayerStats>().CurVel;
|
||||
player.GetComponent<PlayerStats>().CurVel = CurVel - (CurVel/10);
|
||||
//Cut it in half?
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingAbilities/Slime.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingAbilities/Slime.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16272419deebd26418bee88aca87e679
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
19
Assets/Scripts/KingScripts/KingAbilities/Wind.cs
Normal file
19
Assets/Scripts/KingScripts/KingAbilities/Wind.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Wind : MonoBehaviour
|
||||
{
|
||||
public Vector3 DirWind;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
DirWind = Vector3.forward;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void OnTriggerStay(Collider other)
|
||||
{
|
||||
other.GetComponent<PlayerMovement>().AddImpact(DirWind, 1);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingAbilities/Wind.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingAbilities/Wind.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3cbfce7770492384d8edacf924191f0a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
40
Assets/Scripts/KingScripts/KingMove.cs
Normal file
40
Assets/Scripts/KingScripts/KingMove.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class KingMove : MonoBehaviour
|
||||
{
|
||||
public float speed = 30.0f;
|
||||
public float rotSpeed = 30.0f;
|
||||
|
||||
private Vector3 newPos;
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
float translation = Input.GetAxis("HorizontalCam") * speed;
|
||||
float rotation = Input.GetAxis("HorizontalCam") * rotSpeed;
|
||||
|
||||
// Make it move 10 meters per second instead of 10 meters per frame...
|
||||
translation *= Time.deltaTime;
|
||||
rotation *= Time.deltaTime;
|
||||
|
||||
// Move translation along the object's z-axis
|
||||
if (transform.position.z <= 61 && transform.position.z >= -80) {
|
||||
transform.Translate(0, 0, -translation);//Is negated to make the Left arrow go left and the right arraow go right
|
||||
transform.rotation = Quaternion.Euler(0, 0, 0);
|
||||
}
|
||||
else if (transform.position.z > 61) {
|
||||
transform.position = new Vector3(-42, 30, 61);//Keeps them from going too far left
|
||||
}
|
||||
else if (transform.position.z < -80) {//Once they rech a certain point they begin to cirlce around the mountain (radius of 42, x^2+z^2=42^2)
|
||||
transform.Rotate(0, -rotation, 0);// Rotates the player as they move along the circumfurance
|
||||
float z = transform.position.z - 0.5f;
|
||||
float x = Mathf.Sqrt((42 * 42) - ((z + 80) * (z + 80)));//Add something based off translation to X and calculate the corespondent Z Z = sqrt(42^2-x^2)-80
|
||||
newPos = new Vector3(-x, 30, z); // make a Vector3 out of the new X and Z
|
||||
transform.position = newPos;//Sets the player's new position on the cirlce
|
||||
}
|
||||
else {
|
||||
Debug.Log("Aw, Beans");
|
||||
transform.position = new Vector3(-42, 30, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingMove.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingMove.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c7c6dfc09b66ab4b838e6b155516be9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -9,6 +9,7 @@ TagManager:
|
||||
- PlayerCam
|
||||
- HookPoint
|
||||
- Floor
|
||||
- Weather
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
@@ -17,6 +18,7 @@ TagManager:
|
||||
- Water
|
||||
- UI
|
||||
- Floor
|
||||
- Weather
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
15
ProjectSettings/TimelineSettings.asset
Normal file
15
ProjectSettings/TimelineSettings.asset
Normal file
@@ -0,0 +1,15 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &1
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 61
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
assetDefaultFramerate: 60
|
||||
@@ -24,10 +24,10 @@ EditorUserSettings:
|
||||
value: 224247031146467c0c03096f3d2c4a1e02161124623d28393930
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-6:
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-7:
|
||||
value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9
|
||||
value: 22424703114646680e0b0227036c7b151b180b650d262f3d192c0e27d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-8:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
|
||||
Reference in New Issue
Block a user