Pull request #15: Louis

Merge in CEGJ/creative-jam-20 from Louis to main

* commit '4e3658bed6772d5eca5d93eca10e1431776f0438':
  changed cursor
  added game scene and explosion particle system
  clean up test scene and trying to debug raycast
This commit is contained in:
Louis Horlaville 2022-05-15 04:58:19 +00:00
commit b49d74c938
20 changed files with 35116 additions and 181 deletions

BIN
Assets/Art/Materials/Explosion.mat (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Assets/Art/Materials/Explosion.mat.meta (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Assets/Art/circle.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Assets/Art/circle.png.meta (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Assets/Art/cursor.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Assets/Art/cursor.png.meta (Stored with Git LFS) Normal file

Binary file not shown.

8
Assets/Particles.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 225162e97d412cc4d81497df1a969ecd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0a208950d4f32da48b5b03e103af591b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -11,7 +11,6 @@ GameObject:
- component: {fileID: 1039445016908976971}
- component: {fileID: 5972276832283679259}
- component: {fileID: 1790704820881565271}
- component: {fileID: 6221104859356534203}
- component: {fileID: 7767178052037687813}
- component: {fileID: 2748099788876613564}
- component: {fileID: 5856909421887883047}
@ -32,7 +31,7 @@ Transform:
m_GameObject: {fileID: 4677231174284622268}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 22.7, z: 70.77}
m_LocalScale: {x: 20, y: 20, z: 20}
m_LocalScale: {x: 47.045998, y: 47.045998, z: 47.045998}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
@ -88,19 +87,6 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &6221104859356534203
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4677231174284622268}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &7767178052037687813
MonoBehaviour:
m_ObjectHideFlags: 0
@ -158,5 +144,5 @@ SphereCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 1
m_Radius: 1.37
m_Center: {x: 0, y: 0, z: 0}

View File

@ -95,7 +95,7 @@ SphereCollider:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5630905120393344806}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5

View File

@ -11,7 +11,6 @@ GameObject:
- component: {fileID: 4834061105045701539}
- component: {fileID: 4834061105045701550}
- component: {fileID: 4834061105045701537}
- component: {fileID: 4834061105045701536}
m_Layer: 0
m_Name: Cube (7)
m_TagString: Untagged
@ -27,11 +26,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061105045701538}
m_LocalRotation: {x: -0.31063926, y: 0.14804254, z: -0.010474649, w: 0.9388701}
m_LocalPosition: {x: 0.09, y: -1.04, z: 0.75}
m_LocalPosition: {x: 0.09000015, y: -1.0400009, z: 0.75}
m_LocalScale: {x: 1, y: 1, z: 0.33878884}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4834061106301780288}
m_Father: {fileID: 378992053168571211}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: -35.465, y: 20.444, z: -7.879}
--- !u!33 &4834061105045701550
@ -84,19 +83,6 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &4834061105045701536
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061105045701538}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &4834061105164763785
GameObject:
m_ObjectHideFlags: 0
@ -123,11 +109,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061105164763785}
m_LocalRotation: {x: -0.31063926, y: 0.14804254, z: -0.010474649, w: 0.9388701}
m_LocalPosition: {x: 2.38, y: -0.69, z: 2.1}
m_LocalPosition: {x: 2.3799992, y: -0.69000053, z: 2.0999985}
m_LocalScale: {x: 1, y: 1, z: 5.8124256}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4834061106301780288}
m_Father: {fileID: 378992053168571211}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &4834061105164763796
@ -223,7 +209,6 @@ GameObject:
- component: {fileID: 4834061105485588897}
- component: {fileID: 4834061105485588908}
- component: {fileID: 4834061105485588911}
- component: {fileID: 4834061105485588910}
m_Layer: 0
m_Name: Cube (3)
m_TagString: Untagged
@ -243,7 +228,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 5.8124256}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4834061106301780288}
m_Father: {fileID: 378992053168571211}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: -35.465, y: 20.444, z: -7.879}
--- !u!33 &4834061105485588908
@ -296,19 +281,6 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &4834061105485588910
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061105485588896}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &4834061106125087374
GameObject:
m_ObjectHideFlags: 0
@ -320,7 +292,6 @@ GameObject:
- component: {fileID: 4834061106125087375}
- component: {fileID: 4834061106125087370}
- component: {fileID: 4834061106125087373}
- component: {fileID: 4834061106125087372}
m_Layer: 0
m_Name: Cube (9)
m_TagString: Untagged
@ -336,11 +307,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061106125087374}
m_LocalRotation: {x: -0.31063926, y: 0.14804254, z: -0.010474649, w: 0.9388701}
m_LocalPosition: {x: -1.92, y: 0.23, z: 0.55}
m_LocalPosition: {x: -1.9200001, y: 0.22999954, z: 0.54999924}
m_LocalScale: {x: 2.3171, y: 0.22996, z: 0.33878884}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4834061106301780288}
m_Father: {fileID: 378992053168571211}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: -35.465, y: 20.444, z: -7.879}
--- !u!33 &4834061106125087370
@ -393,19 +364,6 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &4834061106125087372
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061106125087374}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &4834061106301780291
GameObject:
m_ObjectHideFlags: 0
@ -438,13 +396,8 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4834061105164763798}
- {fileID: 4834061105485588897}
- {fileID: 4834061106792183646}
- {fileID: 4834061105045701539}
- {fileID: 4834061106819148423}
- {fileID: 4834061106125087375}
- {fileID: 1515961868728325797}
- {fileID: 9175352504942883267}
- {fileID: 378992053168571211}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -460,7 +413,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3d66a652767ef0249ae03fc7183790d7, type: 3}
m_Name:
m_EditorClassIdentifier:
explosion: {fileID: 6113853661072388009}
explosionDebris: {fileID: 6704497973935827627}
landingPoint: {fileID: 0}
body: {fileID: 4916962407531476031}
flyingSpeed: 50
--- !u!54 &3119225800646921348
Rigidbody:
@ -518,7 +474,6 @@ GameObject:
- component: {fileID: 4834061106792183646}
- component: {fileID: 4834061106792183645}
- component: {fileID: 4834061106792183644}
- component: {fileID: 4834061106792183647}
m_Layer: 0
m_Name: Cube (6)
m_TagString: Untagged
@ -538,7 +493,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 0.33878884}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4834061106301780288}
m_Father: {fileID: 378992053168571211}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: -35.465, y: 20.444, z: -7.879}
--- !u!33 &4834061106792183645
@ -591,19 +546,6 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &4834061106792183647
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061106792183633}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &4834061106819148422
GameObject:
m_ObjectHideFlags: 0
@ -615,7 +557,6 @@ GameObject:
- component: {fileID: 4834061106819148423}
- component: {fileID: 4834061106819148418}
- component: {fileID: 4834061106819148421}
- component: {fileID: 4834061106819148420}
m_Layer: 0
m_Name: Cube (8)
m_TagString: Untagged
@ -631,11 +572,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061106819148422}
m_LocalRotation: {x: -0.31063926, y: 0.14804254, z: -0.010474649, w: 0.9388701}
m_LocalPosition: {x: 1.79, y: -0.21, z: -0.51}
m_LocalPosition: {x: 1.789999, y: -0.20999908, z: -0.5099983}
m_LocalScale: {x: 2.3171, y: 0.22996, z: 0.33878884}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4834061106301780288}
m_Father: {fileID: 378992053168571211}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: -35.465, y: 20.444, z: -7.879}
--- !u!33 &4834061106819148418
@ -688,19 +629,44 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &4834061106819148420
BoxCollider:
--- !u!1 &4916962407531476031
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4834061106819148422}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 378992053168571211}
m_Layer: 0
m_Name: Body
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &378992053168571211
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4916962407531476031}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4834061105164763798}
- {fileID: 4834061105485588897}
- {fileID: 4834061106792183646}
- {fileID: 4834061105045701539}
- {fileID: 4834061106819148423}
- {fileID: 4834061106125087375}
- {fileID: 1515961868728325797}
m_Father: {fileID: 4834061106301780288}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7974633672851571803
GameObject:
m_ObjectHideFlags: 0
@ -727,11 +693,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7974633672851571803}
m_LocalRotation: {x: -0.31063926, y: 0.14804254, z: -0.010474649, w: 0.9388701}
m_LocalPosition: {x: -2.6, y: 0.01, z: -1.66}
m_LocalPosition: {x: -2.6000004, y: 0.010000229, z: -1.6599998}
m_LocalScale: {x: 1, y: 1, z: 5.8124256}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4834061106301780288}
m_Father: {fileID: 378992053168571211}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &1492897518398264755
@ -816,3 +782,75 @@ MonoBehaviour:
m_ShadowLayerMask: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
--- !u!1001 &2957969651565829379
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 4834061106301780288}
m_Modifications:
- target: {fileID: 138504292592014834, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_Name
value: Explosion
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
--- !u!198 &6113853661072388009 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 9066894193389433514, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
m_PrefabInstance: {fileID: 2957969651565829379}
m_PrefabAsset: {fileID: 0}
--- !u!198 &6704497973935827627 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 8360924853862332328, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
m_PrefabInstance: {fileID: 2957969651565829379}
m_PrefabAsset: {fileID: 0}
--- !u!4 &9175352504942883267 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6222206415246453952, guid: 0a208950d4f32da48b5b03e103af591b, type: 3}
m_PrefabInstance: {fileID: 2957969651565829379}
m_PrefabAsset: {fileID: 0}

File diff suppressed because it is too large Load Diff

4467
Assets/Scenes/Game.unity Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8bb2bf2697d291f4489c326d05527161
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,8 @@ public class CannonScript : MonoBehaviour
// Update is called once per frame
void Update()
{
Debug.DrawRay(transform.position, lookDir * Mathf.Infinity, Color.red);
if (firing && !EventSystem.current.IsPointerOverGameObject()){
fireTimer += Time.deltaTime;
if(fireTimer >= fireRate){
@ -40,13 +42,11 @@ public class CannonScript : MonoBehaviour
if (Physics.Raycast(transform.position, lookDir, out hit, Mathf.Infinity))
{
Debug.DrawRay(transform.position, lookDir * hit.distance, Color.yellow);
GameObject hitObject = hit.collider.gameObject;
if (hitObject.tag == "Enemy")
{
hitObject.GetComponent<Enemy>().IsShot();
hitObject.GetComponent<Enemy>().IsShot(hit.distance);
}
}
}
@ -91,7 +91,6 @@ public class CannonScript : MonoBehaviour
firing = true;
}else if(ctx.canceled){//btn released
firing = false;
}
}

View File

@ -4,12 +4,12 @@ using UnityEngine;
public class Enemy : MonoBehaviour
{
public ParticleSystem explosion;
public ParticleSystem explosionDebris;
public Transform landingPoint;
public GameObject body;
public float flyingSpeed;
Vector3 launchDirection;
private void Update()
{
//Debug.DrawRay(transform.position, launchDirection, Color.red);
@ -18,28 +18,35 @@ public class Enemy : MonoBehaviour
{
this.landingPoint = landingPoint;
gameObject.transform.LookAt(landingPoint);
GetLaunchDirection();
}
void SpawnFinished()
{
Launch();
StartCoroutine("Launch", 0.01f);
}
//TODO: find direction between spawn point and landing point
void GetLaunchDirection()
{
this.launchDirection = transform.position - landingPoint.position;
}
void Launch()
IEnumerator Launch()
{
yield return new WaitForSeconds(.1f);
gameObject.GetComponent<Rigidbody>().velocity = gameObject.transform.forward * flyingSpeed;
}
public void IsShot()
public void IsShot(float distance)
{
float destroyDelay = Mathf.Sqrt(distance)/(500/5);
Debug.Log(distance+" : "+destroyDelay);
StartCoroutine(Destroy(destroyDelay));
}
private IEnumerator Destroy(float waitTime)
{
gameObject.GetComponent<Rigidbody>().velocity = gameObject.transform.forward * (flyingSpeed / 3);
yield return new WaitForSeconds(waitTime);
body.SetActive(false);
explosion.Emit(100);
explosionDebris.Emit(40);
yield return new WaitForSeconds(3f);
Destroy(gameObject);
}
}

View File

@ -5,7 +5,7 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: 8c9cfa26abfee488c85f1582747f6a02
- enabled: 0
path:
guid: 00000000000000000000000000000000
m_configObjects: {}

View File

@ -14,7 +14,7 @@ PlayerSettings:
accelerometerFrequency: 60
companyName: Conjure
productName: ConjureCreativeJam20
defaultCursor: {fileID: 0}
defaultCursor: {fileID: 2800000, guid: c6535c9f0b512474f9d06a68ab050a30, type: 3}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 1