Allied Ships v1.0

Inital Commit for Allied Ships
This commit is contained in:
Arson Lindgren 2021-11-15 18:15:00 +00:00
parent 004437c741
commit ce283020ab
9 changed files with 564 additions and 0 deletions

View File

@ -593,6 +593,80 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 127769136}
m_CullTransparentMesh: 1
--- !u!1 &147598754
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 147598757}
- component: {fileID: 147598756}
- component: {fileID: 147598755}
m_Layer: 0
m_Name: AlliedSpawner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!61 &147598755
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 147598754}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 12, y: 2}
m_EdgeRadius: 0
--- !u!114 &147598756
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 147598754}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cc69e7fabc02546b282b0275d9d1f9cd, type: 3}
m_Name:
m_EditorClassIdentifier:
prefabToSpawn: {fileID: 8584814050928428254, guid: afdd34142d4fc1f4d879749a3ef23480,
type: 3}
ItemOne: {fileID: 0}
spawnInterval: 30
--- !u!4 &147598757
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 147598754}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 11, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &181023931
GameObject:
m_ObjectHideFlags: 0
@ -3124,6 +3198,7 @@ MonoBehaviour:
difficultyType: 1
incrementDifficultyInSeconds: 30
incrementAmountInSeconds: 30
difficultyCap: 0.5
--- !u!1 &1019999843
GameObject:
m_ObjectHideFlags: 0

View File

@ -0,0 +1,290 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8584814050928428254
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8584814050928428193}
- component: {fileID: 400013377991162835}
- component: {fileID: -8783186668235897460}
- component: {fileID: -6680175077993231875}
- component: {fileID: -6130133216412392447}
- component: {fileID: -59396174693911339}
- component: {fileID: -7131394769972147981}
- component: {fileID: -2870742435845899699}
m_Layer: 0
m_Name: Fishing Boat
m_TagString: Allies
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8584814050928428193
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_LocalRotation: {x: 0, y: 0, z: 0.70710677, w: -0.70710677}
m_LocalPosition: {x: 1.0938661, y: -0.3862818, z: 771.65173}
m_LocalScale: {x: 1.5, y: 1.5, z: 1}
m_Children:
- {fileID: 2865338906138210707}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &400013377991162835
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, 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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 5361590c73c41e945bfec21c6be4a548, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 1
m_DrawMode: 0
m_Size: {x: 0.64, y: 0.32}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!50 &-8783186668235897460
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 4
m_AngularDrag: 0.05
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!60 &-6680175077993231875
PolygonCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.64, y: 0.32}
newSize: {x: 0.64, y: 0.32}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Points:
m_Paths:
- - {x: -0.28, y: 0.12}
- {x: -0.29, y: 0.089999996}
- {x: -0.29, y: -0.13}
- {x: -0.26, y: -0.14}
- {x: -0.17, y: -0.14999999}
- {x: 0.31, y: -0.14999999}
- {x: 0.32, y: -0.11}
- {x: 0.32, y: 0.099999994}
- {x: 0.22999999, y: 0.12}
--- !u!114 &-6130133216412392447
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 71ac1bca4ead7cf4287643b8a4cdaa96, type: 3}
m_Name:
m_EditorClassIdentifier:
rigidbody2D: {fileID: 0}
normalSpeed: 5
returnSpeed: 5
droppedObject: {fileID: 0}
deathEffect: {fileID: 1496494696399852, guid: e61802031429a4e2e8f547dbca07fe84,
type: 3}
--- !u!114 &-59396174693911339
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bdab9334f9a2a4efe8c019b5d37595cd, type: 3}
m_Name:
m_EditorClassIdentifier:
actions: []
useCustomActions: 0
customActions:
m_PersistentCalls:
m_Calls: []
happenOnlyOnce: 1
filterByTag: 0
filterTag: Player
--- !u!114 &-7131394769972147981
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b9c4adaf25c56477b836b81ad48e3bdb, type: 3}
m_Name:
m_EditorClassIdentifier:
pointsWorth: -1
--- !u!210 &-2870742435845899699
SortingGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8584814050928428254}
m_Enabled: 1
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: -5
--- !u!1 &8588598066174533365
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2865338906138210707}
- component: {fileID: 4367181020366926255}
m_Layer: 0
m_Name: fishingBoat
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2865338906138210707
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8588598066174533365}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.0938661, y: 0.3862818, z: -771.65173}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8584814050928428193}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &4367181020366926255
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8588598066174533365}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, 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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 5361590c73c41e945bfec21c6be4a548, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.64, y: 0.32}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0

View File

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

8
Unity-Files/Assets/Images/Ships.meta generated Normal file
View File

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

BIN
Unity-Files/Assets/Images/Ships/Fishing Boat.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 5361590c73c41e945bfec21c6be4a548
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,73 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
[RequireComponent(typeof(Rigidbody2D))]
public class AlliedReturn : Physics2DObject
{
[Header("Movement Speed")]
[Tooltip("The amount of speed in which the boat moves towards the castle")]
public float normalSpeed = 5f;
[Tooltip("The amount of speed in which the boat moves away from the castle")]
public float returnSpeed = 5f;
[Header("Dropped Object")]
public GameObject droppedObject;
[Header("Death Effect When Shot")]
public GameObject deathEffect;
//[Header("Has Droppable Object")]
private bool hasDroppableObject = false;
private bool isReturning = false;
private Vector2 movement = new Vector2(0f, 0f);
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
movement = (isReturning) ? new Vector2(0f, returnSpeed) : new Vector2(0f, -normalSpeed);
}
//FixedUpdate is called every frame when the physics are calculated
void FixedUpdate()
{
rigidbody2D.AddForce(movement);
}
void OnTriggerEnter2D(Collider2D otherCollider)
{
string playerTag = otherCollider.gameObject.tag;
if (playerTag == "Player" || playerTag == "Player2")
{
this.GetComponent<SpriteRenderer>().flipY = false;
isReturning = true;
}
if (playerTag == "Bullet")
{
DestroyShip();
HealthSystemAttribute healthScript = GameObject.Find("CollisionDetector").gameObject.GetComponent<HealthSystemAttribute>();
if (healthScript != null)
{
// subtract health from the player
healthScript.ModifyHealth(-1);
}
Destroy(gameObject);
}
else if (playerTag == "Finish" && isReturning)
{
Destroy(gameObject);
}
}
public void DestroyShip(bool triggerDeathEffect = true)
{
if (deathEffect != null && triggerDeathEffect)
{
GameObject newDeathEffect = Instantiate<GameObject>(deathEffect);
newDeathEffect.transform.position = this.transform.position;
}
Destroy(gameObject);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 71ac1bca4ead7cf4287643b8a4cdaa96
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10,6 +10,7 @@ TagManager:
- Ground
- Pickup
- Pastie
- Allies
layers:
- Default
- TransparentFX