Added player mod (powerups)
This commit is contained in:
91
Assets/Materials/WhiteMat.mat
Normal file
91
Assets/Materials/WhiteMat.mat
Normal file
@@ -0,0 +1,91 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: WhiteMat
|
||||
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _AlphaTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- PixelSnap: 0
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnableExternalAlpha: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _Flip: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/Materials/WhiteMat.mat.meta
Normal file
8
Assets/Materials/WhiteMat.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f49dabfaa53ce947958cc0ed2975b2c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -12,7 +12,7 @@ GameObject:
|
||||
- component: {fileID: 3813189644929098082}
|
||||
m_Layer: 0
|
||||
m_Name: Enemy
|
||||
m_TagString: Untagged
|
||||
m_TagString: Enemy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
138
Assets/Prefabs/PlayerMod.prefab
Normal file
138
Assets/Prefabs/PlayerMod.prefab
Normal file
@@ -0,0 +1,138 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3345171783113818284
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5264147178014863578}
|
||||
- component: {fileID: 8309954331828580361}
|
||||
- component: {fileID: 7594426098938812954}
|
||||
m_Layer: 0
|
||||
m_Name: Model
|
||||
m_TagString: PlayerMod
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5264147178014863578
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3345171783113818284}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6262878747777363767}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8309954331828580361
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3345171783113818284}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &7594426098938812954
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3345171783113818284}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
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: 8f49dabfaa53ce947958cc0ed2975b2c, 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!1 &7367671708397998036
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6262878747777363767}
|
||||
- component: {fileID: 3305490538895218547}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerMod
|
||||
m_TagString: PlayerMod
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6262878747777363767
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7367671708397998036}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 5264147178014863578}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3305490538895218547
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7367671708397998036}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 29014004c04338246b2673078c5d8a52, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_OrbitalPosition:
|
||||
m_AttachedRing: 0
|
||||
m_DistanceFromCentre: 0
|
||||
m_DistanceAlongRadius: 0
|
||||
m_ObjectRadius: 0
|
||||
m_IsAttachedToRings: 0
|
||||
m_Behaviour: {fileID: 0}
|
||||
m_SpinSpeed: 0
|
||||
7
Assets/Prefabs/PlayerMod.prefab.meta
Normal file
7
Assets/Prefabs/PlayerMod.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 780bf151465173e4a82da2763da54b2b
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -682,6 +682,7 @@ MonoBehaviour:
|
||||
m_GapDistance: 1
|
||||
m_RingPrefab: {fileID: 8276642441649562681, guid: 2b69b065f2beade4d91167a23508e29e, type: 3}
|
||||
m_EnemyPrefab: {fileID: 345795220292517504, guid: ec4a924a38b208240b281bd7983b07b7, type: 3}
|
||||
m_ModifierPrefab: {fileID: 7367671708397998036, guid: 780bf151465173e4a82da2763da54b2b, type: 3}
|
||||
--- !u!4 &1827131557
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -19,5 +19,8 @@ public class GlobalOrbitalSettings : MonoBehaviour
|
||||
[SerializeField] GameObject m_EnemyPrefab;
|
||||
public static GameObject EnemyPrefab => Instance.m_EnemyPrefab;
|
||||
|
||||
[SerializeField] GameObject m_ModifierPrefab;
|
||||
public static GameObject ModifierPrefab => Instance.m_ModifierPrefab;
|
||||
|
||||
private void Start() => Instance = this;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,8 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
private float m_LocalDeltaTimeScale = 1f;
|
||||
private float LocalDeltaTime => Time.deltaTime * m_LocalDeltaTimeScale;
|
||||
|
||||
private bool m_CurrentRingAllowsSpawning;
|
||||
|
||||
private Vector3[] m_PrecalculatedPositions;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] private static void OnApplicationStart()
|
||||
@@ -129,6 +131,10 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
|
||||
m_LastGeneratedRing = ring.m_ID;
|
||||
m_TimeOfLastRingSpawn = Time.time;
|
||||
|
||||
m_CurrentRingAllowsSpawning = Random.Range(0, 25) != 0;
|
||||
if (!m_CurrentRingAllowsSpawning && AllowPlayerInput)
|
||||
Instantiate(GlobalOrbitalSettings.ModifierPrefab);
|
||||
}
|
||||
|
||||
List<Ring> toRemove = new();
|
||||
@@ -209,7 +215,7 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
if (Random.Range(0, 20) == 0 && AllowPlayerInput)
|
||||
if (Random.Range(0, 20) == 0 && AllowPlayerInput && m_CurrentRingAllowsSpawning)
|
||||
Instantiate(GlobalOrbitalSettings.EnemyPrefab);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,11 +54,25 @@ public class PlayerController : OrbitalPositionBehaviour
|
||||
{
|
||||
if (!m_OrbitalPosition.m_IsAttachedToRings)
|
||||
return;
|
||||
|
||||
if (other.CompareTag("Enemy"))
|
||||
{
|
||||
GlobalOrbitalPositionManager.RestartSimulation();
|
||||
m_SuicidePoint = transform.position;
|
||||
m_KillingItself = true;
|
||||
m_DeathLerp = 0f;
|
||||
}
|
||||
|
||||
GlobalOrbitalPositionManager.RestartSimulation();
|
||||
m_SuicidePoint = transform.position;
|
||||
m_KillingItself = true;
|
||||
m_DeathLerp = 0f;
|
||||
else if (other.CompareTag("PlayerMod"))
|
||||
{
|
||||
other.OnCollision(this);
|
||||
Debug.Log("Collided with player mod");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Debug.Log("Unknown collision occured");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSimulationRestart()
|
||||
|
||||
20
Assets/Scripts/PlayerModifier.cs
Normal file
20
Assets/Scripts/PlayerModifier.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerModifier : OrbitalPositionBehaviour
|
||||
{
|
||||
protected override void OnStart()
|
||||
{
|
||||
transform.position = new Vector3(0, 0, -100f);
|
||||
|
||||
m_OrbitalPosition.m_DistanceAlongRadius = Random.Range(0f, Mathf.PI * 2f);
|
||||
m_OrbitalPosition.m_ObjectRadius = 0.3f;
|
||||
m_OrbitalPosition.m_SpinSpeed = 1.6f;
|
||||
}
|
||||
|
||||
public override void OnReachCentre() => Destroy(gameObject);
|
||||
|
||||
public override void OnCollision(OrbitalPositionBehaviour other)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/PlayerModifier.cs.meta
Normal file
11
Assets/Scripts/PlayerModifier.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29014004c04338246b2673078c5d8a52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -5,6 +5,7 @@ TagManager:
|
||||
serializedVersion: 2
|
||||
tags:
|
||||
- Enemy
|
||||
- PlayerMod
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
||||
Reference in New Issue
Block a user