diff options
18 files changed, 544 insertions, 26 deletions
diff --git a/AlienSurvival/Assets/Scripts/GameApp.cs b/AlienSurvival/Assets/Scripts/GameApp.cs new file mode 100644 index 0000000..d5f9d70 --- /dev/null +++ b/AlienSurvival/Assets/Scripts/GameApp.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[DisallowMultipleComponent] +public class GameApp : MonoBehaviour +{ + + void Start() + { + + } + + void Update() + { + GameLoop.Instance.Update(); + TinyCountDown.Instance.Update(); + } + + void LateUpdate() + { + + } + +} diff --git a/AlienSurvival/Assets/Scripts/GameApp.cs.meta b/AlienSurvival/Assets/Scripts/GameApp.cs.meta new file mode 100644 index 0000000..3c64a3e --- /dev/null +++ b/AlienSurvival/Assets/Scripts/GameApp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a8eff5fd2fd4e34e8896ce4c086ba44 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: -1100 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AlienSurvival/Assets/Scripts/TopDown/TopDownTransform.cs b/AlienSurvival/Assets/Scripts/TopDown/TopDownTransform.cs index d624267..213e9ff 100644 --- a/AlienSurvival/Assets/Scripts/TopDown/TopDownTransform.cs +++ b/AlienSurvival/Assets/Scripts/TopDown/TopDownTransform.cs @@ -212,9 +212,8 @@ public class TopDownTransform : MonoBehaviour #if UNITY_EDITOR private void OnDrawGizmos() { - // dash line - Vector3 start = transform.position; - Vector3 end = start - new Vector3(0, m_LocalPosition.z, 0); + Vector3 start = TopDownUtils.Project(position); + Vector3 end = TopDownUtils.Project(positionOnGround); Handles.DrawDottedLine(start, end, 1f); Handles.DrawWireCube(end, new Vector3(0.1f, 0.1f, 0f)); diff --git a/AlienSurvival/Assets/Scripts/TopDown/TopDownUtils.cs b/AlienSurvival/Assets/Scripts/TopDown/TopDownUtils.cs new file mode 100644 index 0000000..f42e123 --- /dev/null +++ b/AlienSurvival/Assets/Scripts/TopDown/TopDownUtils.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TopDownUtils +{ + + /// <summary> + /// 从TopDown空间转到3D空间下(TopDownTransform -> Transform) + /// </summary> + /// <param name="topDownCoord"></param> + /// <param name="z"></param> + /// <returns></returns> + public static Vector3 Project(Vector3 topDownCoord, float z = 0) + { + Vector3 pos = new Vector3(); + + pos.x = topDownCoord.x; + pos.y = topDownCoord.y + topDownCoord.z; + pos.z = z; + + return pos; + } + +}
\ No newline at end of file diff --git a/AlienSurvival/Assets/Scripts/TopDown/TopDownUtils.cs.meta b/AlienSurvival/Assets/Scripts/TopDown/TopDownUtils.cs.meta new file mode 100644 index 0000000..f60e1ef --- /dev/null +++ b/AlienSurvival/Assets/Scripts/TopDown/TopDownUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c60891307755afb4fb72033ed1cd557d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs b/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs index 6bbb140..6ae7d87 100644 --- a/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs +++ b/AlienSurvival/Assets/Scripts/Utils/GameLoop.cs @@ -2,18 +2,17 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -public class GameLoop : MonoBehaviour +public class GameLoop : Singleton<GameLoop> { - static public GameLoop Instance { get; private set; } - public int indexOfUpdate { get; private set; } = 0; - - private void Awake() + public GameLoop() { - Instance = this; + indexOfUpdate = 0; } - private void Update() + public int indexOfUpdate { get; private set; } = 0; + + public void Update() { ++indexOfUpdate; } diff --git a/AlienSurvival/Assets/Scripts/Utils/Singleton.cs b/AlienSurvival/Assets/Scripts/Utils/Singleton.cs new file mode 100644 index 0000000..d7aad49 --- /dev/null +++ b/AlienSurvival/Assets/Scripts/Utils/Singleton.cs @@ -0,0 +1,24 @@ +public class Singleton<T> where T : class, new() +{ + private static T _instance; + private static readonly object syslock = new object(); + + public static T Instance + { + get + { + if (_instance == null) + { + lock (syslock) + { + if (_instance == null) + { + _instance = new T(); + } + } + } + return _instance; + + } + } +}
\ No newline at end of file diff --git a/AlienSurvival/Assets/Scripts/Utils/Singleton.cs.meta b/AlienSurvival/Assets/Scripts/Utils/Singleton.cs.meta new file mode 100644 index 0000000..ff0aab9 --- /dev/null +++ b/AlienSurvival/Assets/Scripts/Utils/Singleton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b80a3ccdebef4b4db85130a4bde2d00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AlienSurvival/Assets/Scripts/Utils/TinyCountDown.cs b/AlienSurvival/Assets/Scripts/Utils/TinyCountDown.cs new file mode 100644 index 0000000..dbeae55 --- /dev/null +++ b/AlienSurvival/Assets/Scripts/Utils/TinyCountDown.cs @@ -0,0 +1,48 @@ +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TinyCountDown :Singleton<TinyCountDown> +{ + + private Dictionary<string, float> m_CountDown = new Dictionary<string, float>(); + public TinyCountDown() + { + } + + public void Set(string key, float time) + { + if (!m_CountDown.ContainsKey(key)) + { + m_CountDown.Add(key, time); + } + else + { + m_CountDown[key] = time; + } + } + + public float Get(string key) + { + if (m_CountDown.ContainsKey(key)) + { + return m_CountDown[key]; + } + return 0; + } + + public void Update() + { + List<string> keys = new List<string>(m_CountDown.Keys); + foreach (var key in keys) + { + m_CountDown[key] -= Time.deltaTime; + if(m_CountDown[key] <= 0) + { + m_CountDown.Remove(key); + } + } + + } +} diff --git a/AlienSurvival/Assets/Scripts/Utils/TinyCountDown.cs.meta b/AlienSurvival/Assets/Scripts/Utils/TinyCountDown.cs.meta new file mode 100644 index 0000000..c9f5545 --- /dev/null +++ b/AlienSurvival/Assets/Scripts/Utils/TinyCountDown.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de0d1a4a5baf48a4083e5d7f457ea8b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AlienSurvival/Assets/Test/Art/sprites/other/arrow.png b/AlienSurvival/Assets/Test/Art/sprites/other/arrow.png Binary files differindex 8501f3d..8e985b0 100644 --- a/AlienSurvival/Assets/Test/Art/sprites/other/arrow.png +++ b/AlienSurvival/Assets/Test/Art/sprites/other/arrow.png diff --git a/AlienSurvival/Assets/Test/Art/ui/weaponicon.meta b/AlienSurvival/Assets/Test/Art/ui/weaponicon.meta new file mode 100644 index 0000000..0ca3c42 --- /dev/null +++ b/AlienSurvival/Assets/Test/Art/ui/weaponicon.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d339f1fd84bbf184b8fe7847aaadfc04 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AlienSurvival/Assets/Test/Art/ui/weaponicon/launch.png b/AlienSurvival/Assets/Test/Art/ui/weaponicon/launch.png Binary files differnew file mode 100644 index 0000000..c413369 --- /dev/null +++ b/AlienSurvival/Assets/Test/Art/ui/weaponicon/launch.png diff --git a/AlienSurvival/Assets/Test/Art/ui/weaponicon/launch.png.meta b/AlienSurvival/Assets/Test/Art/ui/weaponicon/launch.png.meta new file mode 100644 index 0000000..34dae4c --- /dev/null +++ b/AlienSurvival/Assets/Test/Art/ui/weaponicon/launch.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 90058b557b320284b803b4c0b87ff61f +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: 0 + 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: 32 + 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 + - serializedVersion: 3 + buildTarget: Standalone + 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: diff --git a/AlienSurvival/Assets/Test/Prefabs/weapon/space_beam.prefab b/AlienSurvival/Assets/Test/Prefabs/weapon/space_beam.prefab index acdbbb9..94b269f 100644 --- a/AlienSurvival/Assets/Test/Prefabs/weapon/space_beam.prefab +++ b/AlienSurvival/Assets/Test/Prefabs/weapon/space_beam.prefab @@ -117,8 +117,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalRotation: 0 - m_LocalScale: {x: 0, y: 0} --- !u!114 &3972855973997788431 MonoBehaviour: m_ObjectHideFlags: 0 @@ -142,6 +140,7 @@ GameObject: - component: {fileID: 2384770310529106985} - component: {fileID: 988214588} - component: {fileID: 7039965570506506514} + - component: {fileID: 440628565} m_Layer: 0 m_Name: space_beam m_TagString: Untagged @@ -177,8 +176,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_LocalPosition: {x: 7.5824533, y: 2.2287643, z: 0} - m_LocalRotation: 0 - m_LocalScale: {x: 0, y: 0} --- !u!114 &7039965570506506514 MonoBehaviour: m_ObjectHideFlags: 0 @@ -192,3 +189,40 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Beam: {fileID: 833378180519843410} +--- !u!114 &440628565 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2384770310529106990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6bde42b3ff5cbc44ca4e036544c3cde9, type: 3} + m_Name: + m_EditorClassIdentifier: + lifeTime: 2 + alphaCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 34 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 34 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 diff --git a/AlienSurvival/Assets/Test/Scenes/6_PixelCanvas 1.unity b/AlienSurvival/Assets/Test/Scenes/6_PixelCanvas 1.unity index 5e0b75b..20c1704 100644 --- a/AlienSurvival/Assets/Test/Scenes/6_PixelCanvas 1.unity +++ b/AlienSurvival/Assets/Test/Scenes/6_PixelCanvas 1.unity @@ -221,6 +221,130 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 1 +--- !u!1 &153653412 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 153653416} + - component: {fileID: 153653415} + - component: {fileID: 153653414} + - component: {fileID: 153653413} + - component: {fileID: 153653417} + m_Layer: 0 + m_Name: launch + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &153653413 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153653412} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a9f0293bd6e86e43bbbefc99b5e2722, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &153653414 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153653412} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2b1fbd797bf03674e9d1b81edc11e3f1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_LocalPosition: {x: 1.8047028, y: 3.9977598, z: 0} +--- !u!212 &153653415 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153653412} + 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: 90058b557b320284b803b4c0b87ff61f, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1.65625, y: 0.625} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &153653416 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153653412} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.8047028, y: 3.9977598, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 21 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &153653417 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153653412} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1ce201566412034c99687a8c5b94075, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Color: {r: 0, g: 0, b: 0, a: 0.22745098} + m_Scale: {x: 1, y: 0.5} --- !u!1 &185848754 GameObject: m_ObjectHideFlags: 0 @@ -809,6 +933,67 @@ MonoBehaviour: m_EditorClassIdentifier: m_Color: {r: 0, g: 0, b: 0, a: 0.22745098} m_Scale: {x: 1, y: 0.5} +--- !u!1001 &440628563 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_RootOrder + value: 20 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalPosition.x + value: 7.5824533 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalPosition.y + value: 2.2287643 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalPosition.z + value: -3.0223687 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106985, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106990, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_Name + value: space_beam + objectReference: {fileID: 0} + - target: {fileID: 2384770310529106990, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: aaee1eb6bb697a34c822ff018eca2fdf, type: 3} --- !u!1 &500022324 GameObject: m_ObjectHideFlags: 0 @@ -1382,7 +1567,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 844062961} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2.1415555, y: 8.509748, z: 0} + m_LocalPosition: {x: 2.1415555, y: 7.551978, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -1426,7 +1611,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2b1fbd797bf03674e9d1b81edc11e3f1, type: 3} m_Name: m_EditorClassIdentifier: - m_LocalPosition: {x: 2.1415555, y: 6.2179737, z: 2.2917752} + m_LocalPosition: {x: 2.1415555, y: 6.2179737, z: 1.3340044} --- !u!1 &917445573 GameObject: m_ObjectHideFlags: 0 @@ -3855,9 +4040,9 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1863642746} - - component: {fileID: 1863642747} + - component: {fileID: 1863642748} m_Layer: 0 - m_Name: GameLoop + m_Name: GameApp m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3877,7 +4062,7 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1863642747 +--- !u!114 &1863642748 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -3886,7 +4071,7 @@ MonoBehaviour: m_GameObject: {fileID: 1863642745} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5ce4c552f3823e842853a52a52d3cc3b, type: 3} + m_Script: {fileID: 11500000, guid: 4a8eff5fd2fd4e34e8896ce4c086ba44, type: 3} m_Name: m_EditorClassIdentifier: --- !u!1 &1896371513 diff --git a/AlienSurvival/Assets/Test/Scripts/TestPeaceMaker.cs b/AlienSurvival/Assets/Test/Scripts/TestPeaceMaker.cs index 9bbde78..11f76ba 100644 --- a/AlienSurvival/Assets/Test/Scripts/TestPeaceMaker.cs +++ b/AlienSurvival/Assets/Test/Scripts/TestPeaceMaker.cs @@ -77,14 +77,13 @@ public class TestPeaceMaker : MonoBehaviour bool isFire = Fire(); bool isGrenade = LaunchGrenade(); + bool isBeam = SpaceBeam(); CallB2(); - SpaceBeam(); - CameraFollow(); - CameraZoom(/*isMove ||*/ isFire || isGrenade); + CameraZoom(/*isMove ||*/ isFire || isGrenade /*|| isBeam*/); } void CameraZoom(bool zout) @@ -297,15 +296,19 @@ public class TestPeaceMaker : MonoBehaviour } } - void SpaceBeam() + bool SpaceBeam() { - if (Input.GetButtonDown("Fire3")) + if (Input.GetButtonDown("SpaceBeam")) { TestSpaceBeam beam = Instantiate<TestSpaceBeam>(m_SpaceBeam); Vector3 pos3D = m_Coord.position; beam.Set(pos3D + new Vector3(3, 0, 0)); + + TinyCountDown.Instance.Set("SpaceBeam", 0.1f); + return true; } + return TinyCountDown.Instance.Get("SpaceBeam") > 0; } } diff --git a/AlienSurvival/ProjectSettings/InputManager.asset b/AlienSurvival/ProjectSettings/InputManager.asset index 3ed6332..61e0a46 100644 --- a/AlienSurvival/ProjectSettings/InputManager.asset +++ b/AlienSurvival/ProjectSettings/InputManager.asset @@ -202,7 +202,7 @@ InputManager: descriptiveName: descriptiveNegativeName: negativeButton: - positiveButton: joystick button 1 + positiveButton: altNegativeButton: altPositiveButton: gravity: 1000 @@ -549,3 +549,19 @@ InputManager: type: 2 axis: 8 joyNum: 0 + - serializedVersion: 3 + m_Name: SpaceBeam + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 |