projectile and enemy collision. Iniitial player death state (teleport to start)

This commit is contained in:
joonasp
2022-04-25 17:46:26 +03:00
parent fd683b4580
commit f2db095ab9
23 changed files with 25594 additions and 723 deletions
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 10f2e5d2e4dd2ba42b4dcf6195a74f02
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8bc88477f037e96478019bba8de301fd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 8183020133918107436} - component: {fileID: 8183020133918107436}
m_Layer: 0 m_Layer: 0
m_Name: EssenceWell m_Name: EssenceWell
m_TagString: Untagged m_TagString: Portal
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
@@ -217,6 +217,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 08f72f5d017837743b67d344a6a7ed52, type: 3} m_Script: {fileID: 11500000, guid: 08f72f5d017837743b67d344a6a7ed52, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
spawnLocation: {fileID: 0}
--- !u!1 &2674332924243185464 --- !u!1 &2674332924243185464
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -8,6 +8,7 @@ public class Projectile : MonoBehaviour
Vector3 oldEulerAngles; Vector3 oldEulerAngles;
public float damage; public float damage;
private string element = null;
private void Start() private void Start()
{ {
@@ -28,10 +29,14 @@ public class Projectile : MonoBehaviour
private void OnCollisionEnter(Collision collision) private void OnCollisionEnter(Collision collision)
{ {
Debug.LogWarning(collision.gameObject.name); Debug.LogWarning(collision.gameObject.name);
if (collision.gameObject.tag != "IceBolt" && collision.gameObject.tag != "Player" && !collided) GameObject obj = collision.gameObject;
if (obj.tag != "IceBolt" && obj.tag != "Player" && !collided)
{ {
collided = true; collided = true;
if (collision.gameObject.name == "Dummy") Destroy(collision.gameObject); //REPLACE WITH ENEMY TAG CHECK AND DAMAGE CHECKING if (obj.CompareTag("Slime"))
{
obj.GetComponent<SlimeAI>().GetHit(Mathf.RoundToInt(damage));
}
Destroy(gameObject); Destroy(gameObject);
} }
@@ -68,6 +68,10 @@ public class CraftingTable : MonoBehaviour
item1 = null; item1 = null;
} }
} }
else if((item1.name.StartsWith("wand") && item2.name.StartsWith("Crystal")) || (item2.name.StartsWith("wand") && item1.name.StartsWith("Crystal")))
{
}
} }
Debug.LogError("Invalid Recipe!"); Debug.LogError("Invalid Recipe!");
@@ -14,24 +14,28 @@ public class PlayerInfo : MonoBehaviour
private GameObject rightHandHeld; private GameObject rightHandHeld;
private GameObject leftHandHeld; private GameObject leftHandHeld;
public Transform spawnLocation;
private void Awake() private void Awake()
{ {
Instance = this; Instance = this;
health = 5; health = 5;
essence_basic = 0; essence_basic = 1;
rightHandHeld = null; rightHandHeld = null;
leftHandHeld = null; leftHandHeld = null;
} }
public bool AddHealth(int value) public void AddHealth(int value)
{ {
health += value; health += value;
if (health <= 0) if (health <= 0)
{ {
transform.position = spawnLocation.position;
health = 5;
Debug.Log("NO HEALTH REMAINING"); Debug.Log("NO HEALTH REMAINING");
return false;
} }
return true;
} }
public bool AddEssenceBasic(int value) public bool AddEssenceBasic(int value)
@@ -6,14 +6,9 @@ public class WandData : MonoBehaviour
{ {
public float power = 1f; public float power = 1f;
//public string element = "water"; public string element = null;
private void Awake()
{
}
public void SetPower(float pow) public void SetPower(float pow)
{ {
power = pow; power = pow;
@@ -24,7 +24,7 @@ MonoBehaviour:
m_Value: 0.75 m_Value: 0.75
smoothness: smoothness:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 0.4 m_Value: 0.543
rounded: rounded:
m_OverrideState: 0 m_OverrideState: 0
m_Value: 0 m_Value: 0
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: da52a93af762fab4ab9085821b0fb632 guid: 021cda96e596cdc4096a187243d67191
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:
File diff suppressed because one or more lines are too long
+7 -12
View File
@@ -176,7 +176,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 16 m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &407110722 stripped --- !u!4 &407110722 stripped
Transform: Transform:
@@ -706,7 +706,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!114 &629412355 --- !u!114 &629412355
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -737,7 +737,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 11 m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &629412357 --- !u!114 &629412357
MonoBehaviour: MonoBehaviour:
@@ -1120,7 +1120,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 14 m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &913183357 --- !u!1 &913183357
GameObject: GameObject:
@@ -1187,7 +1187,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 9 m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &953161746 --- !u!1001 &953161746
PrefabInstance: PrefabInstance:
@@ -1435,7 +1435,7 @@ Transform:
m_ConstrainProportionsScale: 1 m_ConstrainProportionsScale: 1
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 14 m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1479875001 --- !u!1 &1479875001
GameObject: GameObject:
@@ -1550,11 +1550,6 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Lever value: Lever
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa, - target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
@@ -1995,7 +1990,7 @@ PrefabInstance:
type: 3} type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_Target propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value: value:
objectReference: {fileID: 48807395} objectReference: {fileID: 0}
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa, - target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3} type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_CallState propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
@@ -21,7 +21,7 @@ MonoBehaviour:
m_Value: {x: 0.5, y: 0.5} m_Value: {x: 0.5, y: 0.5}
intensity: intensity:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 0 m_Value: 0.304
smoothness: smoothness:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 1 m_Value: 1
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 3829f2d229e9f9b44b6d3f85cb2d6653
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 2dc48376fb0fbaa4f93eb47a43ad6560
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+13 -13
View File
@@ -90,19 +90,19 @@ Material:
- _HorizonCloudSize: 4.91 - _HorizonCloudSize: 4.91
- _HorizonCloudStartPosition: -0.1 - _HorizonCloudStartPosition: -0.1
- _HorizonCloudStep: 25 - _HorizonCloudStep: 25
- _HorizonExponent: 4.212204 - _HorizonExponent: 3.3921747
- _HorizonStep: 500 - _HorizonStep: 500
- _HorizonThickness: 1 - _HorizonThickness: 1
- _MoonGlow: 0 - _MoonGlow: 0
- _MoonLightIntensity: 0.11609189 - _MoonLightIntensity: 0.00034078956
- _MoonSize: 0 - _MoonSize: 0
- _MoonSoftEdge: 0 - _MoonSoftEdge: 0
- _OverheadCloudAltitude: 1000 - _OverheadCloudAltitude: 1000
- _OverheadCloudAnimationSpeed: 50 - _OverheadCloudAnimationSpeed: 50
- _OverheadCloudFlowDirectionX: 1 - _OverheadCloudFlowDirectionX: 1
- _OverheadCloudFlowDirectionZ: 1 - _OverheadCloudFlowDirectionZ: 1
- _OverheadCloudRemapMax: 1 - _OverheadCloudRemapMax: 1.074074
- _OverheadCloudRemapMin: -0.40113193 - _OverheadCloudRemapMin: 0.111940965
- _OverheadCloudSize: 10 - _OverheadCloudSize: 10
- _OverheadCloudStep: 2 - _OverheadCloudStep: 2
- _StarsDensity0: 0.4 - _StarsDensity0: 0.4
@@ -112,7 +112,7 @@ Material:
- _StarsGlow0: 0.01 - _StarsGlow0: 0.01
- _StarsGlow1: 0.01 - _StarsGlow1: 0.01
- _StarsGlow2: 0.01 - _StarsGlow2: 0.01
- _StarsOpacity: 0.77006197 - _StarsOpacity: 0.0009148121
- _StarsSize0: 0.42 - _StarsSize0: 0.42
- _StarsSize1: 0.53 - _StarsSize1: 0.53
- _StarsSize2: 0.46 - _StarsSize2: 0.46
@@ -121,25 +121,25 @@ Material:
- _StarsTwinkle1: 6 - _StarsTwinkle1: 6
- _StarsTwinkle2: 2 - _StarsTwinkle2: 2
- _SunGlow: 0.45 - _SunGlow: 0.45
- _SunLightIntensity: 0.00026742788 - _SunLightIntensity: 0.22252172
- _SunSize: 0.1 - _SunSize: 0.1
- _SunSoftEdge: 0.5 - _SunSoftEdge: 0.5
m_Colors: m_Colors:
- _DetailOverlayTintColor: {r: 0, g: 0, b: 0, a: 0} - _DetailOverlayTintColor: {r: 0, g: 0, b: 0, a: 0}
- _FogColor: {r: 0, g: 0, b: 0, a: 0} - _FogColor: {r: 0, g: 0, b: 0, a: 0}
- _GroundColor: {r: 0.32409453, g: 0.28410664, b: 0.36156124, a: 1} - _GroundColor: {r: 0.4100945, g: 0.38965663, b: 0.42924377, a: 1}
- _HorizonCloudColor: {r: 1, g: 1, b: 1, a: 1} - _HorizonCloudColor: {r: 1, g: 1, b: 1, a: 1}
- _HorizonColor: {r: 0.4159287, g: 0.36391956, b: 0.5471698, a: 1} - _HorizonColor: {r: 0.9055729, g: 0.85231304, b: 0.741789, a: 1}
- _MoonColor: {r: 1, g: 1, b: 1, a: 1} - _MoonColor: {r: 1, g: 1, b: 1, a: 0}
- _MoonDirection: {r: 1, g: 1, b: 1, a: 0} - _MoonDirection: {r: 1, g: 1, b: 1, a: 0}
- _MoonLightColor: {r: 0, g: 0, b: 0, a: 0} - _MoonLightColor: {r: 0, g: 0, b: 0, a: 0}
- _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.8412408} - _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.9640542}
- _SkyColor: {r: 0.08056989, g: 0.03172837, b: 0.21698111, a: 1} - _SkyColor: {r: 0.20533016, g: 0.35421106, b: 0.5882197, a: 1}
- _StarsColor0: {r: 0.96470594, g: 0.9450981, b: 0.76470596, a: 1} - _StarsColor0: {r: 0.96470594, g: 0.9450981, b: 0.76470596, a: 1}
- _StarsColor1: {r: 1, g: 0.5294118, b: 0.93725497, a: 1} - _StarsColor1: {r: 1, g: 0.5294118, b: 0.93725497, a: 1}
- _StarsColor2: {r: 0, g: 0.92549026, b: 1, a: 1} - _StarsColor2: {r: 0, g: 0.92549026, b: 1, a: 1}
- _SunColor: {r: 0.991845, g: 0.9783889, b: 0.95618623, a: 0} - _SunColor: {r: 0.9742516, g: 0.93176544, b: 0.86166334, a: 1}
- _SunDirection: {r: 0, g: 0.8362344, b: 0.54837215, a: 0} - _SunDirection: {r: 0, g: -0.258819, b: 0.9659258, a: 0}
- _SunLightColor: {r: 1, g: 0.9929226, b: 0.9009434, a: 1} - _SunLightColor: {r: 1, g: 0.9929226, b: 0.9009434, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []
--- !u!114 &11400000 --- !u!114 &11400000
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -27,17 +27,17 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorBlend: - _ColorBlend:
m_Texture: {fileID: -1194533861416839154, guid: b6bbea2e1167a7346822545139402874, m_Texture: {fileID: 5281641662269304446, guid: b6bbea2e1167a7346822545139402874,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorByHeight: - _ColorByHeight:
m_Texture: {fileID: 4148794505670020756, guid: b6bbea2e1167a7346822545139402874, m_Texture: {fileID: 5080985662299159844, guid: b6bbea2e1167a7346822545139402874,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorByNormal: - _ColorByNormal:
m_Texture: {fileID: 9206949218771078510, guid: b6bbea2e1167a7346822545139402874, m_Texture: {fileID: 1559664983853682635, guid: b6bbea2e1167a7346822545139402874,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
@@ -40,17 +40,17 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorBlend: - _ColorBlend:
m_Texture: {fileID: -1638983025302772359, guid: 726ce83d589353742be6b48ff467fc48, m_Texture: {fileID: -632991581987057756, guid: 726ce83d589353742be6b48ff467fc48,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorByHeight: - _ColorByHeight:
m_Texture: {fileID: 5693894473929199623, guid: 726ce83d589353742be6b48ff467fc48, m_Texture: {fileID: -3017630409839315693, guid: 726ce83d589353742be6b48ff467fc48,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorByNormal: - _ColorByNormal:
m_Texture: {fileID: 1037727246875307785, guid: 726ce83d589353742be6b48ff467fc48, m_Texture: {fileID: 3937040956866931151, guid: 726ce83d589353742be6b48ff467fc48,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
@@ -40,17 +40,17 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorBlend: - _ColorBlend:
m_Texture: {fileID: -5980367444381717797, guid: 7f589c682d367b442b8cf75918f5aa55, m_Texture: {fileID: -4194580542534478640, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorByHeight: - _ColorByHeight:
m_Texture: {fileID: 1925041048746766459, guid: 7f589c682d367b442b8cf75918f5aa55, m_Texture: {fileID: 378771951295068396, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _ColorByNormal: - _ColorByNormal:
m_Texture: {fileID: -1661191792390972591, guid: 7f589c682d367b442b8cf75918f5aa55, m_Texture: {fileID: -6356769439334433299, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2} type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}