Death Square Added
This commit is contained in:
parent
3496f6042a
commit
64fb6d3bcf
|
@ -0,0 +1,135 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &8378017212783071875
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1204334895034878381}
|
||||||
|
- component: {fileID: 1785641170992784563}
|
||||||
|
- component: {fileID: 7247606339416968181}
|
||||||
|
- component: {fileID: 8027659600259984568}
|
||||||
|
m_Layer: 7
|
||||||
|
m_Name: Death Square
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 2147483647
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1204334895034878381
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8378017212783071875}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 100, y: 25, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!212 &1785641170992784563
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8378017212783071875}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
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: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||||
|
m_Color: {r: 1, g: 0.4009434, b: 0.4009434, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!61 &7247606339416968181
|
||||||
|
BoxCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8378017212783071875}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
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: 1, y: 1}
|
||||||
|
newSize: {x: 1, y: 1}
|
||||||
|
adaptiveTilingThreshold: 0.5
|
||||||
|
drawMode: 0
|
||||||
|
adaptiveTiling: 0
|
||||||
|
m_AutoTiling: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_EdgeRadius: 0
|
||||||
|
--- !u!50 &8027659600259984568
|
||||||
|
Rigidbody2D:
|
||||||
|
serializedVersion: 4
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8378017212783071875}
|
||||||
|
m_BodyType: 2
|
||||||
|
m_Simulated: 1
|
||||||
|
m_UseFullKinematicContacts: 0
|
||||||
|
m_UseAutoMass: 0
|
||||||
|
m_Mass: 1
|
||||||
|
m_LinearDrag: 0
|
||||||
|
m_AngularDrag: 0.05
|
||||||
|
m_GravityScale: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Interpolate: 0
|
||||||
|
m_SleepingMode: 1
|
||||||
|
m_CollisionDetection: 0
|
||||||
|
m_Constraints: 0
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8317c6de9f7b2f14f87cd8c0a0131c3c
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,8 @@
|
||||||
|
using System;
|
||||||
using Cinemachine;
|
using Cinemachine;
|
||||||
using Level;
|
using Level;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
using UnityEngine.U2D;
|
using UnityEngine.U2D;
|
||||||
|
|
||||||
namespace Camera
|
namespace Camera
|
||||||
|
@ -20,20 +22,18 @@ namespace Camera
|
||||||
{
|
{
|
||||||
_cinemachineVirtualCamera = GetComponent<CinemachineVirtualCamera>();
|
_cinemachineVirtualCamera = GetComponent<CinemachineVirtualCamera>();
|
||||||
pixelPerfectCamera = GameObject.FindObjectOfType<PixelPerfectCamera>();
|
pixelPerfectCamera = GameObject.FindObjectOfType<PixelPerfectCamera>();
|
||||||
|
LevelManager.Instance.OnLevelChanged.AddListener(UpdateCamera);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void UpdateCamera()
|
||||||
{
|
{
|
||||||
if (LevelManager.Instance.CurrentLevel?.FixedCameraPoint == null)
|
if (LevelManager.Instance.CurrentLevel.FixedCameraPoint == null)
|
||||||
{
|
{
|
||||||
if (_cinemachineVirtualCamera.Follow == null)
|
_cinemachineVirtualCamera.Follow = LevelManager.Instance.Player.transform;
|
||||||
{
|
pixelPerfectCamera.refResolutionX = FollowResolutionX;
|
||||||
_cinemachineVirtualCamera.Follow = LevelManager.Instance.Player.transform;
|
pixelPerfectCamera.refResolutionY = FollowResolutionY;
|
||||||
pixelPerfectCamera.refResolutionX = FollowResolutionX;
|
|
||||||
pixelPerfectCamera.refResolutionY = FollowResolutionY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (_cinemachineVirtualCamera.Follow != LevelManager.Instance.CurrentLevel.FixedCameraPoint)
|
else
|
||||||
{
|
{
|
||||||
_cinemachineVirtualCamera.Follow = LevelManager.Instance.CurrentLevel.FixedCameraPoint;
|
_cinemachineVirtualCamera.Follow = LevelManager.Instance.CurrentLevel.FixedCameraPoint;
|
||||||
pixelPerfectCamera.refResolutionX = FixedResolutionX;
|
pixelPerfectCamera.refResolutionX = FixedResolutionX;
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UI;
|
using UI;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
|
|
||||||
namespace Level
|
namespace Level
|
||||||
{
|
{
|
||||||
|
@ -38,6 +39,8 @@ namespace Level
|
||||||
private Level currentLevel = null;
|
private Level currentLevel = null;
|
||||||
public Level CurrentLevel => currentLevel;
|
public Level CurrentLevel => currentLevel;
|
||||||
|
|
||||||
|
public UnityEvent OnLevelChanged = new UnityEvent();
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
if (_instance == null)
|
if (_instance == null)
|
||||||
|
@ -92,6 +95,7 @@ namespace Level
|
||||||
Player.GetComponent<Rigidbody2D>().velocity = Vector2.zero;
|
Player.GetComponent<Rigidbody2D>().velocity = Vector2.zero;
|
||||||
|
|
||||||
UIManager.Instance.CloseAllCanvases();
|
UIManager.Instance.CloseAllCanvases();
|
||||||
|
OnLevelChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DisableAllLevels()
|
public void DisableAllLevels()
|
||||||
|
|
Loading…
Reference in New Issue