添加成都双流圣菲学校场景

This commit is contained in:
ZYT
2025-11-25 15:38:35 +08:00
parent f31282758f
commit 75eaf2fdf2
65 changed files with 31517 additions and 201 deletions

View File

@@ -7,6 +7,7 @@ using TMPro;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;
using static UnityEngine.Advertisements.Advertisement;
public class AIController : MonoBehaviour
@@ -40,6 +41,7 @@ public class AIController : MonoBehaviour
//文本变量
public TMP_Text speedTxt;
public TMP_Text banben;
private const float TxtSpeed = 1; //文字显示时间
public Image dialogBoxImage;//对话框图像
@@ -72,6 +74,7 @@ public class AIController : MonoBehaviour
{
dialogBoxImage.gameObject.SetActive(false);
}
banben.text = $"v{Application.version}";
}

View File

@@ -1,5 +1,140 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1202069264737515409
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4692778627297904382}
- component: {fileID: 3869969704973105513}
- component: {fileID: 1574677476322771041}
m_Layer: 0
m_Name: speedTxt (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4692778627297904382
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1202069264737515409}
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: []
m_Father: {fileID: 9099877221861591467}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 463, y: 285.5}
m_SizeDelta: {x: 135.8, y: 107.3}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3869969704973105513
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1202069264737515409}
m_CullTransparentMesh: 1
--- !u!114 &1574677476322771041
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1202069264737515409}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 9861a6325d4fe384cabed1305ec8e929, type: 2}
m_sharedMaterial: {fileID: -709690668904339887, guid: 9861a6325d4fe384cabed1305ec8e929,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 63.56
m_fontSizeBase: 63.56
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 2
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &2590438463261420928
GameObject:
m_ObjectHideFlags: 0
@@ -345,6 +480,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1886413755794540654}
- {fileID: 4692778627297904382}
m_Father: {fileID: 1252382800004615965}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -563,4 +699,5 @@ MonoBehaviour:
rotationSmoothness: 5
charDisplayDelay: 0.1
speedTxt: {fileID: 2527627372886660134}
banben: {fileID: 1574677476322771041}
dialogBoxImage: {fileID: 6769398298817694151}

View File

@@ -0,0 +1,213 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4343628017236969733
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7841662660239278266}
- component: {fileID: 77177896380764645}
- component: {fileID: 4546999576943407951}
- component: {fileID: 2383961893696304072}
m_Layer: 0
m_Name: "\u6210\u90FD\u53CC\u6D41\u5723\u975E\u5B66\u6821"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7841662660239278266
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4343628017236969733}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -2.5, z: 22.95}
m_LocalScale: {x: 8.3, y: 5, z: 45.9}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8378475046808953946}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &77177896380764645
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4343628017236969733}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &4546999576943407951
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4343628017236969733}
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: 31321ba15b8f8eb4c954353edc038b1d, 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!65 &2383961893696304072
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4343628017236969733}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &5269613113293612308
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8378475046808953946}
- component: {fileID: 4507890143438053235}
- component: {fileID: 6379846963990302012}
- component: {fileID: 5640429327005756842}
m_Layer: 0
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8378475046808953946
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5269613113293612308}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.6216867, y: 0, z: 0.075816974}
m_LocalScale: {x: 0.25301203, y: 1, z: 0.8474945}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7841662660239278266}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &4507890143438053235
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5269613113293612308}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &6379846963990302012
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5269613113293612308}
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: 31321ba15b8f8eb4c954353edc038b1d, 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!65 &5640429327005756842
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5269613113293612308}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

View File

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

8
Assets/Magic_Spline.meta Normal file
View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -0,0 +1,140 @@
fileFormatVersion: 2
guid: e6f1be8867d4eb246825875f8ab19c1e
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 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
- serializedVersion: 3
buildTarget: Windows Store Apps
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: iPhone
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: Android
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:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -9,7 +9,7 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<data android:scheme="picoapp" android:host="launch" android:path="/com.pineappletech.defendnj.shandongjinanhuayinshengfutongShangnaowai"/>
<data android:scheme="picoapp" android:host="launch" android:path="/com.pineappletech.defendnj.jiangsuxvzhouguolououlebao"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

View File

@@ -102,6 +102,9 @@ MonoBehaviour:
playerNpcPre:
- {fileID: 3403295139079388272, guid: b3692701bb78ec141ab7c1b1ba95ed88, type: 3}
- {fileID: 8517616133156376474, guid: 9ed134ebc6ea90c449d5f0f9a3e12495, type: 3}
PathGuidePre: {fileID: 718552219040796497, guid: 1090ff9efb8eaa94cbdc6dfa4042d3b7,
type: 3}
pathGuide: {fileID: 0}
EnemyUIPre: {fileID: 905399022738026712, guid: 5495a17eb1e04dc42b68347dae126e2f,
type: 3}
gameMode: 1
@@ -116,7 +119,6 @@ MonoBehaviour:
player: {fileID: 4948796608574586180, guid: 87ce953c4bdf37541a0348358ed9e7e7, type: 3}
aiCharacterPre: {fileID: 3138103488680208938, guid: fd270e281173bf348a948a0a3a30594b,
type: 3}
MRauduo: {fileID: 6005443052536508214, guid: b91cbd41a922b5843843cbf88c74b029, type: 3}
curRoundEnemyCount: 0
curEnemyEventType: 0
NpcEnemyList: []

View File

@@ -15,7 +15,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &4948796607817774772
Transform:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -9735,7 +9735,7 @@ MonoBehaviour:
IncludeChildColliders: 0
RuntimeFollower: {fileID: 0}
colliderMaxDistance: 100
lastTimeMaxDistanceCalced: 638971677945700744
lastTimeMaxDistanceCalced: 638994043430319746
--- !u!82 &675942809
AudioSource:
m_ObjectHideFlags: 0

View File

@@ -897,7 +897,7 @@ Transform:
m_GameObject: {fileID: 107388153}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.287, y: 0, z: 3.14}
m_LocalPosition: {x: 0.13, y: 0, z: 3.72}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -8254,7 +8254,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &638622008
Transform:
m_ObjectHideFlags: 0
@@ -9370,7 +9370,7 @@ MonoBehaviour:
IncludeChildColliders: 0
RuntimeFollower: {fileID: 0}
colliderMaxDistance: 100
lastTimeMaxDistanceCalced: 638985517516429332
lastTimeMaxDistanceCalced: 638995893054784189
--- !u!82 &675942809
AudioSource:
m_ObjectHideFlags: 0
@@ -13233,7 +13233,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
version: 1073741824
data:
dataString: UEsDBBQAAAgIAABAIexsZoeHxQIAAAIGAAALACQAZ3JhcGgwLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQFlVMtu4jAU/RXk9bRKSkNhdjNA6SzaotJRF5MuXPuGWBg7sp0Crfj3uXYcklIJKeHc1zn3kU8ilK2AOW0WRvB7zYH8HBD/Tn4MOuMd7Olaq5X4gNbnRXBXeicafJ6oExrx1IdZvQVnBPul1tI7JwjWShTabOd8DVNtnUW4oNICmox2Ploh9Dkg+xhwiM8P/xwc8Y2BcmB6XpfJOLu+SdPszH14mWWjSTrJbkJcrZik2wq459+F38SodBi8FAqLDl4E01IKG1kRd6iC6imtbI2a0IELiioDn+QyvUakBLEuXfifTfopHovCgosEDT3MhMGWNbnJb930cUvtpiH3TmXtq2VXje4m7/03++g6mAujt3dt6TTxNVwp2OaJHhi1rtfoPjzr6KehRzsqN/RNwksJ6kEvjK4VR6MztQ+tLVzNeqlO2qYlsE3n13Btwda7rr7PNu1mewzy9ysH1UlI0mF/LdiV1GECsYy3RGTiPcHg9P6gnLBINsYj6ili/DNd9zcuGm6FsQ5NkU1Eve8SBwQcFIPY9gvvoDy5N10bn4vMA1Pfi9pNtVEQ4EiwAkWlOywxozvfgDNbj9eZ5Zb644vsoq29qbOQAHf+SXJmWurdadYGN9iGtW7f/r36EdhS7+7Blo+1k0L1uu0ND9jgqVaqWdx+M9uwVW0KynphDvauNjCjjoZqSAf3i/dDsZchQtVS+lUOAgIjFOB/r76/JcW6MsDkQatwfl+egf66FvzrgZB0PByN6ShLUp6whE4uGC/4OGHFMINiyN4yEi5IKGw3lcumX3FKuF2q06LwWtpP42BhaBVulhu6W4iPre5NXqhCr5gBUI9NhpNYMFgEvzB8zgXKXIFzQoW9JJ85kZptgOenRHlo7HzvDM27LDmpxLt2HsnJNHwQc+Lh00Hi6r4L2PniX5KBxNEBfxYStrTypuRIjv8BUEsDBBQAAAgIAABAIezOMuSTbAAAAHcAAAAJACQAbWV0YS5qc29uCgAgAAAAAAABABgAAIA+1d6xnQEAgD7V3rGdAQCAPtXesZ0Bq1YqSy0qzszPU7JSMNUz1DPTUVBKL0osyCgGChiCOKWZKSB2tJKhhbGZRaKZqYFhikGyQaKlbnJKWoqFQXKasWlqmnFykqlSLFB9SWVBql9ibipET0BiSUZaZl5KZl66nntRZoo7yGil2FoAUEsBAi0AFAAACAgAAEAh7Gxmh4fFAgAAAgYAAAsAJAAAAAAAAAAAAAAAAAAAAGdyYXBoMC5qc29uCgAgAAAAAAABABgAAIA+1d6xnQEAgD7V3rGdAQCAPtXesZ0BUEsBAi0AFAAACAgAAEAh7M4y5JNsAAAAdwAAAAkAJAAAAAAAAAAAAAAAEgMAAG1ldGEuanNvbgoAIAAAAAAAAQAYAACAPtXesZ0BAIA+1d6xnQEAgD7V3rGdAVBLBQYAAAAAAgACALgAAADJAwAAAAA=
dataString: UEsDBBQAAAgIAABAIey0g7BlxgIAAAQGAAALACQAZ3JhcGgwLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQFlVMtu4jAU/RXk9bRKgFCY3QxQOou2qHTUxdCFa98QC2NHtlOgFf8+145DUiohJZz7Ouc+8kmEsiUwp83CCH6vOZCfPeLfyY9ea7yDA91otRIf0Pi8CO4K70SDzxN1QiOe+jCrd+CMYL/URnrnBMFKiVyb3ZxvYKqtswjnVFpAk9HORyuEPnvkEAOO8fnhn70TvjFQDkzH6zoZZ8ObNEmG/YuAwXWWjSbpJLsJkZViku5K4F5BmyCLUekgeCmUFh28DKalFDbyIu5YBt1TWtoKVaEDFxR1BkbJdTpEpACxKVz4n026KR7z3IKLBA09zoTBptW5yW9dd3JH7bYm905l5atl/Vp5nff+m300DObc6N1dUxrbgZArBNs+0SOj1nVa3YVnLf009GhP5Za+SXgpQD3ohdGV4mh0pvKhlYX+rJPqrG1aANu2fjXXBmy8q/L7dNN2uqcg/7ByUJ6FJC3214JdSR0mEMt4S0Qm3hMMTu8PygmrZGM8op4ixj/TTXfnouFWGOvQFNlE1PsucUDAQTGIbb/yDsqTe9OV8bnIPDD1vajcVBsFAY4ES1BUuuMSM7rLDbiwdXhdWG6pP7/ILtqaq7oICXDrnyQXpqXen2dtcINtWOvm7d+rH4Et9P4ebPFYOSlUp9ve8IANnmql6sXtNrMJW1Ump6wT5uDgKgMz6miohnRwv3g3FHsZIlQlpV/lICAwQgH+9+r7W1CsKwNMHrQK5/flGehvKsG/HghJx4PRmI6yJOUJS+jkivGcjxOWDzLIB+wtI+GChMJ2U7ms+xWnhNulWi0Kr6X5OPYWhpbhZrmh+4X42OnO5IXK9YoZAPVYZziLBYNF8AvD51ygzBU4J1TYS/K5JlKzLfD1OdE6NHZ+cIau2yxrUop37TyyJtPwSVwTD58PElf3XcDeF/+SDCSODvizkLCjpTclJ3L6D1BLAwQUAAAICAAAQCHszjLkk2wAAAB3AAAACQAkAG1ldGEuanNvbgoAIAAAAAAAAQAYAACAPtXesZ0BAIA+1d6xnQEAgD7V3rGdAatWKkstKs7Mz1OyUjDVM9Qz01FQSi9KLMgoBgoYgjilmSkgdrSSoYWxmUWimamBYYpBskGipW5ySlqKhUFymrFpappxcpKpUixQfUllQapfYm4qRE9AYklGWmZeSmZeup57UWaKO8hopdhaAFBLAQItABQAAAgIAABAIey0g7BlxgIAAAQGAAALACQAAAAAAAAAAAAAAAAAAABncmFwaDAuanNvbgoAIAAAAAAAAQAYAACAPtXesZ0BAIA+1d6xnQEAgD7V3rGdAVBLAQItABQAAAgIAABAIezOMuSTbAAAAHcAAAAJACQAAAAAAAAAAAAAABMDAABtZXRhLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQFQSwUGAAAAAAIAAgC4AAAAygMAAAAA
file_cachedStartup: {fileID: 0}
cacheStartup: 0
showNavGraphs: 1
@@ -13495,7 +13495,7 @@ Transform:
m_GameObject: {fileID: 1055672619}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.32, y: 0, z: 1.75}
m_LocalPosition: {x: 0.09, y: 0, z: 2.56}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -15316,8 +15316,8 @@ Transform:
m_GameObject: {fileID: 1149045381}
serializedVersion: 2
m_LocalRotation: {x: -0, y: 0.6459946, z: -0, w: -0.76334196}
m_LocalPosition: {x: -2.77, y: -1.2429583, z: 0.13}
m_LocalScale: {x: 438.6573, y: 438.6573, z: 438.6573}
m_LocalPosition: {x: -2.581, y: -1.2429583, z: 0.038}
m_LocalScale: {x: 438.6573, y: 638, z: 438.6573}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 447232897968930313}
@@ -37384,7 +37384,6 @@ Transform:
- {fileID: 8089283717826954949}
- {fileID: 7716397062887050372}
- {fileID: 161415905838992972}
- {fileID: 884924574379678325}
- {fileID: 5540461289374296033}
- {fileID: 1005431809698729385}
- {fileID: 5943247583675837425}
@@ -42238,24 +42237,6 @@ Transform:
m_Children: []
m_Father: {fileID: 6859806167392447511}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &752463148973659910
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 884924574379678325}
- component: {fileID: 7952619550185108007}
- component: {fileID: 8932555809114435714}
m_Layer: 3
m_Name: "\u5730\u96F7\u6307\u793A\u724C"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
--- !u!4 &795025475853670609
Transform:
m_ObjectHideFlags: 0
@@ -46922,21 +46903,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
--- !u!4 &884924574379678325
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 752463148973659910}
serializedVersion: 2
m_LocalRotation: {x: -0.0020325622, y: -0.95823854, z: -0.285882, w: 0.0068125026}
m_LocalPosition: {x: -2.46, y: -0.96795833, z: -2.04}
m_LocalScale: {x: 0.2205899, y: 0.22058992, z: 0.22058992}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 447232897968930313}
m_LocalEulerAnglesHint: {x: -33.224, y: -179.185, z: 0}
--- !u!1 &897626278561231225
GameObject:
m_ObjectHideFlags: 0
@@ -188970,14 +188936,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 0
--- !u!33 &7952619550185108007
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 752463148973659910}
m_Mesh: {fileID: -4748302750131855904, guid: 8165766269b4d5a4d99c63da6ebddf52, type: 3}
--- !u!1 &7990947598120213018
GameObject:
m_ObjectHideFlags: 0
@@ -217974,49 +217932,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
--- !u!23 &8932555809114435714
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 752463148973659910}
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: 196ff43674ae69446b178e19b7921fa8, type: 2}
- {fileID: 2100000, guid: c8a462f3e988bef4bb250e92f494df8e, 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 &8964057775479145777
GameObject:
m_ObjectHideFlags: 0

View File

@@ -180,7 +180,7 @@ Transform:
m_GameObject: {fileID: 107388153}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.23, y: 0, z: 5.07}
m_LocalPosition: {x: -0.03, y: 0, z: 5.07}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -6329,21 +6329,6 @@ Transform:
- {fileID: 9106380954088341073}
m_Father: {fileID: 2189932455864420361}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &273086311674282125
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7353579675996777867}
serializedVersion: 2
m_LocalRotation: {x: -0.2858514, y: 0.015662504, z: 0.00467292, w: 0.9581346}
m_LocalPosition: {x: -2.389, y: -0.96795833, z: -2.619}
m_LocalScale: {x: 0.2205899, y: 0.22058992, z: 0.22058992}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7073809237498568851}
m_LocalEulerAnglesHint: {x: -33.224, y: 1.873, z: 0}
--- !u!1 &276512025746137446
GameObject:
m_ObjectHideFlags: 0
@@ -16578,49 +16563,6 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!23 &508105098986117065
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7353579675996777867}
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: 196ff43674ae69446b178e19b7921fa8, type: 2}
- {fileID: 2100000, guid: c8a462f3e988bef4bb250e92f494df8e, 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!4 &510673354921213949
Transform:
m_ObjectHideFlags: 0
@@ -166955,7 +166897,7 @@ Transform:
m_GameObject: {fileID: 3737742993013382963}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -207.26, y: 2.02605, z: -497.03}
m_LocalPosition: {x: -207.26, y: 1.64, z: -497.03}
m_LocalScale: {x: 0.59342, y: 0.59342, z: 0.59342}
m_ConstrainProportionsScale: 0
m_Children:
@@ -193406,7 +193348,6 @@ Transform:
- {fileID: 8168614109174411158}
- {fileID: 5671630246525501919}
- {fileID: 5431180235697900876}
- {fileID: 273086311674282125}
- {fileID: 6044080305363940055}
- {fileID: 4010360672001531630}
- {fileID: 2189932455864420361}
@@ -194849,24 +194790,6 @@ Transform:
- {fileID: 1690129356894347855}
m_Father: {fileID: 5823754499110305426}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7353579675996777867
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 273086311674282125}
- component: {fileID: 8415646112296809474}
- component: {fileID: 508105098986117065}
m_Layer: 3
m_Name: "\u5730\u96F7\u6307\u793A\u724C"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
--- !u!1 &7354966737238110853
GameObject:
m_ObjectHideFlags: 0
@@ -236168,14 +236091,6 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!33 &8415646112296809474
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7353579675996777867}
m_Mesh: {fileID: -4748302750131855904, guid: 8165766269b4d5a4d99c63da6ebddf52, type: 3}
--- !u!1 &8416457816857563373
GameObject:
m_ObjectHideFlags: 0

View File

@@ -63,6 +63,7 @@ public enum Place
Hunan_Changde_Lixian_WandaGuangchang=39,
Jilin_Changchun_Beihu_WuyueGuangchang = 41,
Chongqing_Yuzhong_Hongyadong_Xiakexing=42,
Chengdu_Shuangliu_ShengfeiXuexiao=43,
}

View File

@@ -97,6 +97,9 @@ public class GameManager : NetworkBehaviour
public GameObject enemyPlanePre;
public GameObject[] playerNpcPre;
//public GameObject PathGuidePre;
//public GuideArrowPath pathGuide;//引导路径
// 怪物ui预制体
public GameObject EnemyUIPre;
#endregion
@@ -167,7 +170,7 @@ public class GameManager : NetworkBehaviour
[SyncVar]
public long vistEnd = 0;
// 总游玩时长
private int vistAllTime = (int)(60*12 );
private int vistAllTime = (int)(60*12);
[SyncVar]
public string settleData = "";
@@ -204,7 +207,7 @@ public class GameManager : NetworkBehaviour
isStart = false;
CreateDoor();
}
}
//修改处添加创建AI角色的方法
@@ -238,6 +241,8 @@ public class GameManager : NetworkBehaviour
{
//注册AI介绍完成回调
aiController.OnIntroductionComplete += StartGameAfterIntroduction;
// 新增注册AI离开回调
// aiController.OnIntroductionComplete += CreateGuidancePathToDoor;
//添加延迟,确保所有组件已经完成初始化
StartCoroutine(DelayedStartIntroduction(aiController));
@@ -258,6 +263,57 @@ public class GameManager : NetworkBehaviour
yield return new WaitForSeconds(0.1f); // 短暂延迟
aiController.StartIntroduction();
}
//// 新增:创建从玩家到门的指引路径
//private void CreateGuidancePathToDoor()
//{
// Debug.Log("AI离开创建从玩家到门的指引路径");
// // 确保玩家和门的位置存在
// if (player == null || GameLocal.Ins.doorPos == null)
// {
// Debug.LogError("无法创建指引路径:玩家或门的位置为空");
// return;
// }
// // 创建指引路径
// CreatePathGuide();
// // 设置路径从玩家位置到门的位置
// Vector3 startPos = player.transform.position;
// Vector3 endPos = GameLocal.Ins.doorPos.position;
// pathGuide.SetPath(startPos, endPos);
// pathGuide.ShowPath();
// Debug.Log($"指引路径已创建:从 {startPos} 到 {endPos}");
// // 可选:在玩家到达门后自动关闭指引
// StartCoroutine(CheckPlayerReachedDoor());
//}
//// 新增:检查玩家是否到达门的位置
//private IEnumerator CheckPlayerReachedDoor()
//{
// if (player == null || GameLocal.Ins.doorPos == null) yield break;
// float arrivalDistance = 2.0f; // 到达门的判定距离
// while (pathGuide != null && pathGuide.gameObject.activeInHierarchy)
// {
// float distanceToDoor = Vector3.Distance(player.transform.position, GameLocal.Ins.doorPos.position);
// if (distanceToDoor <= arrivalDistance)
// {
// Debug.Log("玩家已到达门的位置,关闭指引路径");
// ClosePathGuide();
// yield break;
// }
// yield return new WaitForSeconds(0.5f); // 每0.5秒检查一次
// }
//}
void Awake()
{
Ins = this;
@@ -358,6 +414,42 @@ public class GameManager : NetworkBehaviour
}
[Server]
//public void PlayEndEvent()
//{
// Debug.LogError("开启End事件");
// gameState = GameState.EndEvent;
// GivePistol(GunType.MeleeWeapon);
// foreach (var item in PlayerAiList.Values)
// {
// item.EndEvent();
// }
// PlaySound2DRPC("1.61");
// OpenDoor();
// for (int i = 0; i < 7; i++)
// {
// Transform[] targetPos = GameLocal.Ins.enemyEndPos;
// GameObject enemy = Instantiate(enemyEndAiPre);
// NetworkServer.Spawn(enemy);
// int posId =i/3;
// enemy.transform.position = GameLocal.Ins.enemyStartPos[posId].position;
// enemy.transform.eulerAngles = targetPos[posId].eulerAngles;
// enemyIndex++;
// Enemy enemyScript = enemy.GetComponent<Enemy>();
// enemyScript.OnSpawn(enemyIndex, 3, 1,GameLocal.Ins.pkPos.position);
// enemyScript.ai.maxSpeed = 2;
// EnemyList.Add(enemyIndex, enemyScript);
// GameObject playerAi = Instantiate(playerEndAiPres);
// NetworkServer.Spawn(playerAi);
// playerAi.transform.position = GameLocal.Ins.endPlayerStartPos.position;
// playerAi.transform.eulerAngles = AiInfos[1].EulerAngles;
// PlayerAI playerAI = playerAi.GetComponent<PlayerAI>();
// playerAI.OnSpawn(i+2,PlayerAIType.EndPlayerAi, 1,enemy);
// playerAI.ai.maxSpeed = 2;
// PlayerAiList.Add(i+2, playerAI);
// }
// curRoundEnemyCount = EnemyList.Count;
//}
public void PlayEndEvent()
{
Debug.LogError("开启End事件");
@@ -369,32 +461,123 @@ public class GameManager : NetworkBehaviour
}
PlaySound2DRPC("1.61");
OpenDoor();
// 定义3x3范围的中心点和大小
Vector3 centerPos = GameLocal.Ins.pkPos.position;
float areaSize = 3f; // 3x3的范围
for (int i = 0; i < 7; i++)
{
Transform[] targetPos = GameLocal.Ins.enemyEndPos;
GameObject enemy = Instantiate(enemyEndAiPre);
NetworkServer.Spawn(enemy);
int posId =i/3;
enemy.transform.position = GameLocal.Ins.enemyStartPos[posId].position;
enemy.transform.eulerAngles = targetPos[posId].eulerAngles;
// 检查是否为指定场地
if (GameLocal.Ins.place == Place.Jiangsu_Xvzhou_Guolou_Oulebao)
{
// 在3x3范围内随机生成位置
Vector3 randomOffset = new Vector3(
Random.Range(-areaSize / 2f, areaSize / 2f),
0,
Random.Range(-areaSize / 2f, areaSize / 2f)
);
enemy.transform.position = centerPos + randomOffset;
enemy.transform.eulerAngles = Vector3.zero; // 或者设置随机朝向
}
else
{
// 原有逻辑
int posId = i / 3;
enemy.transform.position = GameLocal.Ins.enemyStartPos[posId].position;
enemy.transform.eulerAngles = targetPos[posId].eulerAngles;
}
enemyIndex++;
Enemy enemyScript = enemy.GetComponent<Enemy>();
enemyScript.OnSpawn(enemyIndex, 3, 1,GameLocal.Ins.pkPos.position);
enemyScript.OnSpawn(enemyIndex, 3, 1, GameLocal.Ins.pkPos.position);
enemyScript.ai.maxSpeed = 2;
EnemyList.Add(enemyIndex, enemyScript);
GameObject playerAi = Instantiate(playerEndAiPres);
NetworkServer.Spawn(playerAi);
playerAi.transform.position = GameLocal.Ins.endPlayerStartPos.position;
playerAi.transform.eulerAngles = AiInfos[1].EulerAngles;
// 检查是否为指定场地
if (GameLocal.Ins.place == Place.Jiangsu_Xvzhou_Guolou_Oulebao)
{
// 在3x3范围内随机生成位置确保与敌人位置不重叠
Vector3 randomOffset;
bool positionValid;
int attempts = 0;
do
{
randomOffset = new Vector3(
Random.Range(-areaSize / 2f, areaSize / 2f),
0,
Random.Range(-areaSize / 2f, areaSize / 2f)
);
// 检查是否与现有单位位置太近
positionValid = true;
Vector3 proposedPos = centerPos + randomOffset;
foreach (var existingEnemy in EnemyList.Values)
{
if (Vector3.Distance(proposedPos, existingEnemy.transform.position) < 0.8f) // 稍微减小最小距离
{
positionValid = false;
break;
}
}
attempts++;
if (attempts > 15) break; // 增加尝试次数
} while (!positionValid);
playerAi.transform.position = centerPos + randomOffset;
playerAi.transform.eulerAngles = Vector3.zero; // 或者设置随机朝向
}
else
{
// 原有逻辑
playerAi.transform.position = GameLocal.Ins.endPlayerStartPos.position;
playerAi.transform.eulerAngles = AiInfos[1].EulerAngles;
}
PlayerAI playerAI = playerAi.GetComponent<PlayerAI>();
playerAI.OnSpawn(i+2,PlayerAIType.EndPlayerAi, 1,enemy);
playerAI.OnSpawn(i + 2, PlayerAIType.EndPlayerAi, 1, enemy);
playerAI.ai.maxSpeed = 2;
PlayerAiList.Add(i+2, playerAI);
PlayerAiList.Add(i + 2, playerAI);
}
curRoundEnemyCount = EnemyList.Count;
// 可选:在指定场地时添加调试可视化
if (GameLocal.Ins.place == Place.Jiangsu_Xvzhou_Guolou_Oulebao)
{
Debug.Log($"在场地 {GameLocal.Ins.place} 中所有单位已生成在3x3范围内中心点: {centerPos}");
// 可视化3x3范围仅在编辑器中
#if UNITY_EDITOR
DrawDebugArea(centerPos, areaSize);
#endif
}
}
// 调试用绘制3x3区域
private void DrawDebugArea(Vector3 center, float size)
{
Vector3 bottomLeft = center + new Vector3(-size / 2, 0, -size / 2);
Vector3 bottomRight = center + new Vector3(size / 2, 0, -size / 2);
Vector3 topLeft = center + new Vector3(-size / 2, 0, size / 2);
Vector3 topRight = center + new Vector3(size / 2, 0, size / 2);
Debug.DrawLine(bottomLeft, bottomRight, Color.red, 10f);
Debug.DrawLine(bottomRight, topRight, Color.red, 10f);
Debug.DrawLine(topRight, topLeft, Color.red, 10f);
Debug.DrawLine(topLeft, bottomLeft, Color.red, 10f);
}
[ClientRpc]
public void OpenDoor()
{
@@ -1310,5 +1493,26 @@ public class GameManager : NetworkBehaviour
MasterAudio.PlaySound(JointIn);
GameLocal.Ins.BGMState.StateChange(2);
}
//#region 引导系统
//public void CreatePathGuide()
//{
// var pathGuideObj = Instantiate(PathGuidePre);
// pathGuide = pathGuideObj.GetComponent<GuideArrowPath>();
// pathGuide.ClosePath();
//}
//public void ShowPathGuide()
//{
// pathGuide.ShowPath();
//}
//public void ClosePathGuide()
//{
// pathGuide.ClosePath();
//}
//#endregion
}

View File

@@ -33,13 +33,14 @@ public enum HandState
public class Player : NetworkRoomPlayer,IDamagable
{
public Transform LeftHand;
public Transform RightHand;
public Transform Aim;
public Collider Collider;
public LayerMask AimLayer;
[SyncVar]
public bool isDie;
@@ -204,6 +205,7 @@ public class Player : NetworkRoomPlayer,IDamagable
other.gameObject.SetActive(false);
NetworkServer.Destroy(other.gameObject);
GameManager.Ins.GameStart();
}
if (other.tag == "WeaponProp")
@@ -491,6 +493,8 @@ public class Player : NetworkRoomPlayer,IDamagable
}
#endregion
}

8
Assets/_Valheim.meta Normal file
View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,176 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &718552219040796497
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 718552219040796499}
- component: {fileID: 718552219040796498}
- component: {fileID: 718552219040796508}
- component: {fileID: -1289911475552001029}
m_Layer: 0
m_Name: PathGuide
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &718552219040796499
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718552219040796497}
serializedVersion: 2
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: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!120 &718552219040796498
LineRenderer:
serializedVersion: 2
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718552219040796497}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: d89e79b4cfdd0ae4e9a7b611c4b172b1, 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_Positions:
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 1}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 4
textureScale: {x: 1, y: 1}
shadowBias: 0.5
generateLightingData: 0
m_MaskInteraction: 0
m_UseWorldSpace: 0
m_Loop: 0
m_ApplyActiveColorSpace: 0
--- !u!114 &718552219040796508
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718552219040796497}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8cdda35296b966646ada44468a5c40c5, type: 3}
m_Name:
m_EditorClassIdentifier:
syncDirection: 0
syncMode: 0
syncInterval: 0
targetDoor: {fileID: 2201411466238183738, guid: 1becc5b2e4b48c74a941f2abfebff177,
type: 3}
aircraftBody: {fileID: 4948796608574586183, guid: 87ce953c4bdf37541a0348358ed9e7e7,
type: 3}
--- !u!114 &-1289911475552001029
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718552219040796497}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneId: 0
_assetId: 4156201627
serverOnly: 0
visible: 0
hasSpawned: 0

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,230 @@
using System;
using System.Collections.Generic;
using Mirror;
using UnityEngine;
[RequireComponent(typeof(LineRenderer))]
public class GuideArrowPath : NetworkBehaviour
{
// 内部变量
private LineRenderer lineRenderer;
// 障碍物检测设置
public LayerMask obstacleMask = 1; // 障碍物层
public float pathHeight = 0.5f; // 路径显示高度
public int maxRaycastPoints = 10; // 最大射线检测点数
void Awake()
{
// 在Awake中初始化确保在其他脚本调用前准备好
InitializeLineRenderer();
}
void Start()
{
// 确保在Start中也有初始化双重保险
InitializeLineRenderer();
}
/// <summary>
/// 初始化LineRenderer
/// </summary>
private void InitializeLineRenderer()
{
if (lineRenderer == null)
{
lineRenderer = GetComponent<LineRenderer>();
if (lineRenderer == null)
{
Debug.LogError("LineRenderer component is missing on " + gameObject.name);
}
}
}
/// <summary>
/// 根据起点与终点计算路径并更新Line Renderer的显示
/// </summary>
public void SetPath(Vector3 start, Vector3 end)
{
// 确保lineRenderer已初始化
if (lineRenderer == null)
{
InitializeLineRenderer();
// 如果仍然为null直接返回
if (lineRenderer == null)
{
Debug.LogError("LineRenderer is still null after initialization!");
return;
}
}
List<Vector3> path = CalculateSimplePath(start, end);
if (path != null && path.Count > 1)
{
lineRenderer.positionCount = path.Count;
// 调整路径点高度
List<Vector3> adjustedPath = new List<Vector3>();
foreach (Vector3 point in path)
{
adjustedPath.Add(new Vector3(point.x, pathHeight, point.z));
}
lineRenderer.SetPositions(adjustedPath.ToArray());
}
else
{
lineRenderer.positionCount = 0;
Debug.LogWarning("未能计算出有效路径!");
}
}
/// <summary>
/// 计算简单路径(直线 + 障碍物避让)
/// </summary>
private List<Vector3> CalculateSimplePath(Vector3 start, Vector3 end)
{
List<Vector3> path = new List<Vector3>();
path.Add(start);
// 检查起点到终点是否有直接路径
if (!Physics.Linecast(start, end, obstacleMask))
{
// 没有障碍物,直接使用直线路径
path.Add(end);
return path;
}
else
{
// 有障碍物,尝试找到绕过障碍物的路径
List<Vector3> obstacleAvoidancePath = FindObstacleAvoidancePath(start, end);
if (obstacleAvoidancePath != null && obstacleAvoidancePath.Count > 0)
{
return obstacleAvoidancePath;
}
}
// 如果无法找到有效路径,返回空路径
return new List<Vector3> { start, end };
}
/// <summary>
/// 寻找绕过障碍物的路径
/// </summary>
private List<Vector3> FindObstacleAvoidancePath(Vector3 start, Vector3 end)
{
List<Vector3> path = new List<Vector3>();
path.Add(start);
Vector3 direction = (end - start).normalized;
float totalDistance = Vector3.Distance(start, end);
// 沿着方向进行多次射线检测,寻找可通行的路径点
for (int i = 1; i <= maxRaycastPoints; i++)
{
float t = (float)i / maxRaycastPoints;
Vector3 testPoint = start + direction * totalDistance * t;
// 检查从上一个点到当前点是否有障碍物
Vector3 lastPoint = path[path.Count - 1];
if (!Physics.Linecast(lastPoint, testPoint, obstacleMask))
{
// 没有障碍物,添加路径点
path.Add(testPoint);
}
else
{
// 有障碍物,尝试绕过
Vector3 bypassPoint = FindBypassPoint(lastPoint, testPoint);
if (bypassPoint != lastPoint) // 确保找到了有效的绕过点
{
path.Add(bypassPoint);
}
}
}
// 确保终点被添加
if (path[path.Count - 1] != end)
{
path.Add(end);
}
return path.Count > 1 ? path : null;
}
/// <summary>
/// 寻找绕过障碍物的点
/// </summary>
private Vector3 FindBypassPoint(Vector3 from, Vector3 to)
{
Vector3 direction = (to - from).normalized;
float distance = Vector3.Distance(from, to);
// 尝试从不同方向绕过障碍物
Vector3[] testDirections = {
Vector3.Cross(direction, Vector3.up).normalized, // 右侧
Vector3.Cross(direction, Vector3.down).normalized, // 左侧
Vector3.up, // 上方
new Vector3(direction.z, 0, -direction.x).normalized // 另一个侧向
};
float[] testDistances = { 2f, 3f, 5f }; // 测试不同的绕过距离
foreach (Vector3 testDir in testDirections)
{
foreach (float testDist in testDistances)
{
Vector3 bypassStart = from + testDir * testDist;
Vector3 bypassEnd = to + testDir * testDist;
// 检查绕过路径是否可行
if (!Physics.Linecast(from, bypassStart, obstacleMask) &&
!Physics.Linecast(bypassStart, bypassEnd, obstacleMask) &&
!Physics.Linecast(bypassEnd, to, obstacleMask))
{
return bypassStart;
}
}
}
// 如果找不到绕过点,返回原始起点
return from;
}
public float GetToTargetDis(Vector3 start, Vector3 end)
{
List<Vector3> path = CalculateSimplePath(start, end);
if (path != null && path.Count > 1)
{
float dis = 0;
for (int i = 0; i < path.Count - 1; i++)
{
dis += Vector3.Distance(path[i], path[i + 1]);
}
return dis;
}
return -1;
}
public void ShowPath()
{
if (lineRenderer == null)
InitializeLineRenderer();
if (lineRenderer != null)
lineRenderer.enabled = true;
}
public void ClosePath()
{
if (lineRenderer == null)
InitializeLineRenderer();
if (lineRenderer != null)
lineRenderer.enabled = false;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,163 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System;
using UnityEngine;
public class CameraHolder : MonoBehaviour
{
//camera holder
public Transform Holder;
public float currDistance = 5.0f;
public float xRotate = 250.0f;
public float yRotate = 120.0f;
public float yMinLimit = -20f;
public float yMaxLimit = 80f;
public float prevDistance;
private float x = 0.0f;
private float y = 0.0f;
[Header("GUI")]
private float windowDpi;
public GameObject[] Prefabs;
private int Prefab;
private GameObject Instance;
private float StartColor;
private float HueColor;
public Texture HueTexture;
void Start()
{
if (Screen.dpi < 1) windowDpi = 1;
if (Screen.dpi < 200) windowDpi = 1;
else windowDpi = Screen.dpi / 200f;
var angles = transform.eulerAngles;
x = angles.y;
y = angles.x;
Counter(0);
}
private void OnGUI()
{
if (GUI.Button(new Rect(5 * windowDpi, 5 * windowDpi, 110 * windowDpi, 35 * windowDpi), "Previous effect"))
{
Counter(-1);
}
if (GUI.Button(new Rect(120 * windowDpi, 5 * windowDpi, 110 * windowDpi, 35 * windowDpi), "Play again"))
{
Counter(0);
}
if (GUI.Button(new Rect(235 * windowDpi, 5 * windowDpi, 110 * windowDpi, 35 * windowDpi), "Next effect"))
{
Counter(+1);
}
StartColor = HueColor;
HueColor = GUI.HorizontalSlider(new Rect(5 * windowDpi, 45 * windowDpi, 340 * windowDpi, 35 * windowDpi), HueColor, 0, 1);
GUI.DrawTexture(new Rect(5 * windowDpi, 65 * windowDpi, 340 * windowDpi, 15 * windowDpi), HueTexture, ScaleMode.StretchToFill, false, 0);
if (HueColor != StartColor)
{
int i = 0;
foreach (var ps in particleSystems)
{
var main = ps.main;
Color colorHSV = Color.HSVToRGB(HueColor + H * 0, svList[i].S, svList[i].V);
main.startColor = new Color(colorHSV.r, colorHSV.g, colorHSV.b, svList[i].A);
i++;
}
}
}
private ParticleSystem[] particleSystems = new ParticleSystem[0];
private List<SVA> svList = new List<SVA>();
private float H;
public struct SVA
{
public float S;
public float V;
public float A;
}
void Counter(int count)
{
Prefab += count;
if (Prefab > Prefabs.Length - 1)
{
Prefab = 0;
}
else if (Prefab < 0)
{
Prefab = Prefabs.Length - 1;
}
if (Instance != null)
{
Destroy(Instance);
}
Instance = Instantiate(Prefabs[Prefab]);
particleSystems = Instance.GetComponentsInChildren<ParticleSystem>(); //Get color from current instance
svList.Clear();
foreach (var ps in particleSystems)
{
Color baseColor = ps.main.startColor.color;
SVA baseSVA = new SVA();
Color.RGBToHSV(baseColor, out H, out baseSVA.S, out baseSVA.V);
baseSVA.A = baseColor.a;
svList.Add(baseSVA);
}
}
void LateUpdate()
{
if (currDistance < 2)
{
currDistance = 2;
}
currDistance -= Input.GetAxis("Mouse ScrollWheel") * 2;
if (Holder && (Input.GetMouseButton(0) || Input.GetMouseButton(1)))
{
var pos = Input.mousePosition;
float dpiScale = 1;
if (Screen.dpi < 1) dpiScale = 1;
if (Screen.dpi < 200) dpiScale = 1;
else dpiScale = Screen.dpi / 200f;
if (pos.x < 380 * dpiScale && Screen.height - pos.y < 250 * dpiScale) return;
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
x += (float)(Input.GetAxis("Mouse X") * xRotate * 0.02);
y -= (float)(Input.GetAxis("Mouse Y") * yRotate * 0.02);
y = ClampAngle(y, yMinLimit, yMaxLimit);
var rotation = Quaternion.Euler(y, x, 0);
var position = rotation * new Vector3(0, 0, -currDistance) + Holder.position;
transform.rotation = rotation;
transform.position = position;
}
else
{
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
}
if (prevDistance != currDistance)
{
prevDistance = currDistance;
var rot = Quaternion.Euler(y, x, 0);
var po = rot * new Vector3(0, 0, -currDistance) + Holder.position;
transform.rotation = rot;
transform.position = po;
}
}
static float ClampAngle(float angle, float min, float max)
{
if (angle < -360)
{
angle += 360;
}
if (angle > 360)
{
angle -= 360;
}
return Mathf.Clamp(angle, min, max);
}
}

View File

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

View File

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

View File

@@ -0,0 +1,78 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RaycastInstance : MonoBehaviour
{
public Camera Cam;
public GameObject[] Prefabs;
private int Prefab;
private Ray RayMouse;
private GameObject Instance;
private float windowDpi;
//Double-click protection
private float buttonSaver = 0f;
void Start()
{
if (Screen.dpi < 1) windowDpi = 1;
if (Screen.dpi < 200) windowDpi = 1;
else windowDpi = Screen.dpi / 200f;
Counter(0);
}
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
if (Cam != null)
{
RaycastHit hit;
var mousePos = Input.mousePosition;
RayMouse = Cam.ScreenPointToRay(mousePos);
if (Physics.Raycast(RayMouse.origin, RayMouse.direction, out hit, 40))
{
Instance = Instantiate(Prefabs[Prefab]);
Instance.transform.position = hit.point + hit.normal * 0.01f;
Destroy(Instance, 1.5f);
}
}
else
{
Debug.Log("No camera");
}
}
if ((Input.GetKey(KeyCode.A) || Input.GetAxis("Horizontal") < 0) && buttonSaver >= 0.4f)// left button
{
buttonSaver = 0f;
Counter(-1);
}
if ((Input.GetKey(KeyCode.D) || Input.GetAxis("Horizontal") > 0) && buttonSaver >= 0.4f)// right button
{
buttonSaver = 0f;
Counter(+1);
}
buttonSaver += Time.deltaTime;
}
void OnGUI()
{
GUI.Label(new Rect(10 * windowDpi, 5 * windowDpi, 400 * windowDpi, 20 * windowDpi), "Use the keyboard buttons A/<- and D/-> to change prefabs!");
GUI.Label(new Rect(10 * windowDpi, 20 * windowDpi, 400 * windowDpi, 20 * windowDpi), "Use left mouse button for instancing!");
}
void Counter(int count)
{
Prefab += count;
if (Prefab > Prefabs.Length - 1)
{
Prefab = 0;
}
else if (Prefab < 0)
{
Prefab = Prefabs.Length - 1;
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,111 @@
%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: Shield2bcg 1
m_Shader: {fileID: 4800000, guid: b68b99c2e57cef4419465c63c527201b, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _USEDEPTH_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _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}
- _Flow:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: e6f1be8867d4eb246825875f8ab19c1e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Mask:
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}
- _Noise:
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}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5
- _Depthpower: 0.15
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Emission: 2
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _InvFade: 3
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Opacity: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _Usecenterglow: 0
- _Usedepth: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DistortionSpeedXYPowerZ: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpeedMainTexUVNoiseUV: {r: 0, g: 0, b: 0, a: 0}
- _SpeedMainTexUVNoiseZW: {r: -1, g: 0, b: 0, a: 0}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDistortionOpacity: {r: -1, g: 0, b: 1, a: 0.4}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d89e79b4cfdd0ae4e9a7b611c4b172b1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EGA_EffectSound : MonoBehaviour
{
public bool Repeating = true;
public float RepeatTime = 2.0f;
public float StartTime = 0.0f;
public bool RandomVolume;
public float minVolume = .4f;
public float maxVolume = 1f;
private AudioClip clip;
private AudioSource soundComponent;
void Start ()
{
soundComponent = GetComponent<AudioSource>();
clip = soundComponent.clip;
if (RandomVolume == true)
{
soundComponent.volume = Random.Range(minVolume, maxVolume);
RepeatSound();
}
if (Repeating == true)
{
InvokeRepeating("RepeatSound", StartTime, RepeatTime);
}
}
void RepeatSound()
{
soundComponent.PlayOneShot(clip);
}
}

View File

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

View File

@@ -0,0 +1,125 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System;
using UnityEngine;
public class Hovl_DemoLasers : MonoBehaviour
{
public GameObject FirePoint;
public Camera Cam;
public float MaxLength;
public GameObject[] Prefabs;
private Ray RayMouse;
private Vector3 direction;
private Quaternion rotation;
[Header("GUI")]
private float windowDpi;
private int Prefab;
private GameObject Instance;
private Hovl_Laser LaserScript;
private Hovl_Laser2 LaserScript2;
//Double-click protection
private float buttonSaver = 0f;
void Start ()
{
//LaserEndPoint = new Vector3(0, 0, 0);
if (Screen.dpi < 1) windowDpi = 1;
if (Screen.dpi < 200) windowDpi = 1;
else windowDpi = Screen.dpi / 200f;
Counter(0);
}
void Update()
{
//Enable lazer
if (Input.GetMouseButtonDown(0))
{
Destroy(Instance);
Instance = Instantiate(Prefabs[Prefab], FirePoint.transform.position, FirePoint.transform.rotation);
Instance.transform.parent = transform;
LaserScript = Instance.GetComponent<Hovl_Laser>();
LaserScript2 = Instance.GetComponent<Hovl_Laser2>();
}
//Disable lazer prefab
if (Input.GetMouseButtonUp(0))
{
if (LaserScript) LaserScript.DisablePrepare();
if (LaserScript2) LaserScript2.DisablePrepare();
Destroy(Instance,1);
}
//To change lazers
if ((Input.GetKey(KeyCode.A) || Input.GetAxis("Horizontal") < 0) && buttonSaver >= 0.4f)// left button
{
buttonSaver = 0f;
Counter(-1);
}
if ((Input.GetKey(KeyCode.D) || Input.GetAxis("Horizontal") > 0) && buttonSaver >= 0.4f)// right button
{
buttonSaver = 0f;
Counter(+1);
}
buttonSaver += Time.deltaTime;
//Current fire point
if (Cam != null)
{
RaycastHit hit; //DELATE THIS IF YOU WANT TO USE LASERS IN 2D
var mousePos = Input.mousePosition;
RayMouse = Cam.ScreenPointToRay(mousePos);
//ADD THIS IF YOU WANT TO USE LASERS IN 2D: RaycastHit2D hit = Physics2D.Raycast(RayMouse.origin, RayMouse.direction, MaxLength);
if (Physics.Raycast(RayMouse.origin, RayMouse.direction, out hit, MaxLength)) //CHANGE THIS IF YOU WANT TO USE LASERRS IN 2D: if (hit.collider != null)
{
RotateToMouseDirection(gameObject, hit.point);
//LaserEndPoint = hit.point;
}
else
{
var pos = RayMouse.GetPoint(MaxLength);
RotateToMouseDirection(gameObject, pos);
//LaserEndPoint = pos;
}
}
else
{
Debug.Log("No camera");
}
}
//GUI Text
void OnGUI()
{
GUI.Label(new Rect(10 * windowDpi, 5 * windowDpi, 400 * windowDpi, 20 * windowDpi), "Use the keyboard buttons A/<- and D/-> to change lazers!");
GUI.Label(new Rect(10 * windowDpi, 20 * windowDpi, 400 * windowDpi, 20 * windowDpi), "Use left mouse button for shooting!");
}
//To change prefabs (count - prefab number)
void Counter(int count)
{
Prefab += count;
if (Prefab > Prefabs.Length - 1)
{
Prefab = 0;
}
else if (Prefab < 0)
{
Prefab = Prefabs.Length - 1;
}
}
//To rotate fire point
void RotateToMouseDirection (GameObject obj, Vector3 destination)
{
direction = destination - obj.transform.position;
rotation = Quaternion.LookRotation(direction);
obj.transform.localRotation = Quaternion.Lerp(obj.transform.rotation, rotation, 1);
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6af44eb64ff318b42a219a7abd31ff20
timeCreated: 1536001444
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,115 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System;
using UnityEngine;
public class Hovl_Laser : MonoBehaviour
{
public GameObject HitEffect;
public float HitOffset = 0;
public bool useLaserRotation = false;
public float MaxLength;
private LineRenderer Laser;
public float MainTextureLength = 1f;
public float NoiseTextureLength = 1f;
private Vector4 Length = new Vector4(1,1,1,1);
//private Vector4 LaserSpeed = new Vector4(0, 0, 0, 0); {DISABLED AFTER UPDATE}
//private Vector4 LaserStartSpeed; {DISABLED AFTER UPDATE}
//One activation per shoot
private bool LaserSaver = false;
private bool UpdateSaver = false;
private ParticleSystem[] Effects;
private ParticleSystem[] Hit;
void Start ()
{
//Get LineRender and ParticleSystem components from current prefab;
Laser = GetComponent<LineRenderer>();
Effects = GetComponentsInChildren<ParticleSystem>();
Hit = HitEffect.GetComponentsInChildren<ParticleSystem>();
//if (Laser.material.HasProperty("_SpeedMainTexUVNoiseZW")) LaserStartSpeed = Laser.material.GetVector("_SpeedMainTexUVNoiseZW");
//Save [1] and [3] textures speed
//{ DISABLED AFTER UPDATE}
//LaserSpeed = LaserStartSpeed;
}
void Update()
{
//if (Laser.material.HasProperty("_SpeedMainTexUVNoiseZW")) Laser.material.SetVector("_SpeedMainTexUVNoiseZW", LaserSpeed);
//SetVector("_TilingMainTexUVNoiseZW", Length); - old code, _TilingMainTexUVNoiseZW no more exist
Laser.material.SetTextureScale("_MainTex", new Vector2(Length[0], Length[1]));
Laser.material.SetTextureScale("_Noise", new Vector2(Length[2], Length[3]));
//To set LineRender position
if (Laser != null && UpdateSaver == false)
{
Laser.SetPosition(0, transform.position);
RaycastHit hit; //DELETE THIS IF YOU WANT USE LASERS IN 2D
//ADD THIS IF YOU WANNT TO USE LASERS IN 2D: RaycastHit2D hit = Physics2D.Raycast(transform.position, transform.forward, MaxLength);
if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, MaxLength))//CHANGE THIS IF YOU WANT TO USE LASERRS IN 2D: if (hit.collider != null)
{
//End laser position if collides with object
Laser.SetPosition(1, hit.point);
HitEffect.transform.position = hit.point + hit.normal * HitOffset;
if (useLaserRotation)
HitEffect.transform.rotation = transform.rotation;
else
HitEffect.transform.LookAt(hit.point + hit.normal);
foreach (var AllPs in Effects)
{
if (!AllPs.isPlaying) AllPs.Play();
}
//Texture tiling
Length[0] = MainTextureLength * (Vector3.Distance(transform.position, hit.point));
Length[2] = NoiseTextureLength * (Vector3.Distance(transform.position, hit.point));
//Texture speed balancer {DISABLED AFTER UPDATE}
//LaserSpeed[0] = (LaserStartSpeed[0] * 4) / (Vector3.Distance(transform.position, hit.point));
//LaserSpeed[2] = (LaserStartSpeed[2] * 4) / (Vector3.Distance(transform.position, hit.point));
}
else
{
//End laser position if doesn't collide with object
var EndPos = transform.position + transform.forward * MaxLength;
Laser.SetPosition(1, EndPos);
HitEffect.transform.position = EndPos;
foreach (var AllPs in Hit)
{
if (AllPs.isPlaying) AllPs.Stop();
}
//Texture tiling
Length[0] = MainTextureLength * (Vector3.Distance(transform.position, EndPos));
Length[2] = NoiseTextureLength * (Vector3.Distance(transform.position, EndPos));
//LaserSpeed[0] = (LaserStartSpeed[0] * 4) / (Vector3.Distance(transform.position, EndPos)); {DISABLED AFTER UPDATE}
//LaserSpeed[2] = (LaserStartSpeed[2] * 4) / (Vector3.Distance(transform.position, EndPos)); {DISABLED AFTER UPDATE}
}
//Insurance against the appearance of a laser in the center of coordinates!
if (Laser.enabled == false && LaserSaver == false)
{
LaserSaver = true;
Laser.enabled = true;
}
}
}
public void DisablePrepare()
{
if (Laser != null)
{
Laser.enabled = false;
}
UpdateSaver = true;
//Effects can = null in multiply shooting
if (Effects != null)
{
foreach (var AllPs in Effects)
{
if (AllPs.isPlaying) AllPs.Stop();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7ea4308861e24ac4caa06d26e151d595
timeCreated: 1536001444
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,146 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System;
using UnityEngine;
public class Hovl_Laser2 : MonoBehaviour
{
public float laserScale = 1;
public Color laserColor = new Vector4(1,1,1,1);
public GameObject HitEffect;
public GameObject FlashEffect;
public float HitOffset = 0;
public float MaxLength;
private bool UpdateSaver = false;
private ParticleSystem laserPS;
private ParticleSystem[] Flash;
private ParticleSystem[] Hit;
private Material laserMat;
private int particleCount;
private ParticleSystem.Particle[] particles;
private Vector3[] particlesPositions;
private float dissovleTimer = 0;
private bool startDissovle = false;
void Start()
{
laserPS = GetComponent<ParticleSystem>();
laserMat = GetComponent<ParticleSystemRenderer>().material;
Flash = FlashEffect.GetComponentsInChildren<ParticleSystem>();
Hit = HitEffect.GetComponentsInChildren<ParticleSystem>();
laserMat.SetFloat("_Scale", laserScale);
}
void Update()
{
if (laserPS != null && UpdateSaver == false)
{
//Set start laser point
laserMat.SetVector("_StartPoint", transform.position);
//Set end laser point
RaycastHit hit;
if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, MaxLength))
{
particleCount = Mathf.RoundToInt(hit.distance / (2 * laserScale));
if (particleCount < hit.distance / (2 * laserScale))
{
particleCount += 1;
}
particlesPositions = new Vector3[particleCount];
AddParticles();
laserMat.SetFloat("_Distance", hit.distance);
laserMat.SetVector("_EndPoint", hit.point);
if (Hit != null)
{
HitEffect.transform.position = hit.point + hit.normal * HitOffset;
HitEffect.transform.LookAt(hit.point);
foreach (var AllHits in Hit)
{
if (!AllHits.isPlaying) AllHits.Play();
}
foreach (var AllFlashes in Flash)
{
if (!AllFlashes.isPlaying) AllFlashes.Play();
}
}
}
else
{
//End laser position if doesn't collide with object
var EndPos = transform.position + transform.forward * MaxLength;
var distance = Vector3.Distance(EndPos, transform.position);
particleCount = Mathf.RoundToInt(distance / (2 * laserScale));
if (particleCount < distance / (2 * laserScale))
{
particleCount += 1;
}
particlesPositions = new Vector3[particleCount];
AddParticles();
laserMat.SetFloat("_Distance", distance);
laserMat.SetVector("_EndPoint", EndPos);
if (Hit != null)
{
HitEffect.transform.position = EndPos;
foreach (var AllPs in Hit)
{
if (AllPs.isPlaying) AllPs.Stop();
}
}
}
}
if (startDissovle)
{
dissovleTimer += Time.deltaTime;
laserMat.SetFloat("_Dissolve", dissovleTimer*5);
}
}
void AddParticles()
{
//Old particles settings
/*
var normalDistance = particleCount;
var sh = LaserPS.shape;
sh.radius = normalDistance;
sh.position = new Vector3(0,0, normalDistance);
LaserPS.emission.SetBursts(new[] { new ParticleSystem.Burst(0f, particleCount + 1) });
*/
particles = new ParticleSystem.Particle[particleCount];
for (int i = 0; i < particleCount; i++)
{
particlesPositions[i] = new Vector3(0f, 0f, 0f) + new Vector3(0f, 0f, i * 2 * laserScale);
particles[i].position = particlesPositions[i];
particles[i].startSize3D = new Vector3(0.001f, 0.001f, 2 * laserScale);
particles[i].startColor = laserColor;
}
laserPS.SetParticles(particles, particles.Length);
}
public void DisablePrepare()
{
transform.parent = null;
dissovleTimer = 0;
startDissovle = true;
UpdateSaver = true;
if (Flash != null && Hit != null)
{
foreach (var AllHits in Hit)
{
if (AllHits.isPlaying) AllHits.Stop();
}
foreach (var AllFlashes in Flash)
{
if (AllFlashes.isPlaying) AllFlashes.Stop();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b7c107ae524aed749b3de3034023eb9d
timeCreated: 1536001444
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,48 @@
/*This script created by using docs.unity3d.com/ScriptReference/MonoBehaviour.OnParticleCollision.html*/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ParticleCollisionInstance : MonoBehaviour
{
public GameObject[] EffectsOnCollision;
public float DestroyTimeDelay = 5;
public bool UseWorldSpacePosition;
public float Offset = 0;
public Vector3 rotationOffset = new Vector3(0,0,0);
public bool useOnlyRotationOffset = true;
public bool UseFirePointRotation;
public bool DestoyMainEffect = true;
private ParticleSystem part;
private List<ParticleCollisionEvent> collisionEvents = new List<ParticleCollisionEvent>();
private ParticleSystem ps;
void Start()
{
part = GetComponent<ParticleSystem>();
}
void OnParticleCollision(GameObject other)
{
int numCollisionEvents = part.GetCollisionEvents(other, collisionEvents);
for (int i = 0; i < numCollisionEvents; i++)
{
foreach (var effect in EffectsOnCollision)
{
var instance = Instantiate(effect, collisionEvents[i].intersection + collisionEvents[i].normal * Offset, new Quaternion()) as GameObject;
if (!UseWorldSpacePosition) instance.transform.parent = transform;
if (UseFirePointRotation) { instance.transform.LookAt(transform.position); }
else if (rotationOffset != Vector3.zero && useOnlyRotationOffset) { instance.transform.rotation = Quaternion.Euler(rotationOffset); }
else
{
instance.transform.LookAt(collisionEvents[i].intersection + collisionEvents[i].normal);
instance.transform.rotation *= Quaternion.Euler(rotationOffset);
}
Destroy(instance, DestroyTimeDelay);
}
}
if (DestoyMainEffect == true)
{
Destroy(gameObject, DestroyTimeDelay + 0.5f);
}
}
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 1a959a1b0b8414d4fb8a68bdc12d69ed
timeCreated: 1516192333
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,21 @@
using System.Collections;
using UnityEngine;
public class Rotator : MonoBehaviour
{
public float x = 0f;
public float y = 0f;
public float z = 0f;
void OnEnable()
{
InvokeRepeating("Rotate", 0f, 0.0167f);
}
void OnDisable()
{
CancelInvoke();
}
void Rotate()
{
this.transform.localEulerAngles += new Vector3(x,y,z);
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 268fb4d91644e42409780f6594097609
timeCreated: 1490959302
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,164 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System;
using UnityEngine;
public class HS_CameraHolder : MonoBehaviour
{
//camera holder
public Transform Holder;
public Vector3 cameraPos = new Vector3(0, 0, 0);
public float currDistance = 5.0f;
public float xRotate = 250.0f;
public float yRotate = 120.0f;
public float yMinLimit = -20f;
public float yMaxLimit = 80f;
public float prevDistance;
private float x = 0.0f;
private float y = 0.0f;
[Header("GUI")]
private float windowDpi;
public GameObject[] Prefabs;
private int Prefab;
private GameObject Instance;
private float StartColor;
private float HueColor;
public Texture HueTexture;
void Start()
{
if (Screen.dpi < 1) windowDpi = 1;
if (Screen.dpi < 200) windowDpi = 1;
else windowDpi = Screen.dpi / 200f;
var angles = transform.eulerAngles;
x = angles.y;
y = angles.x;
Counter(0);
}
private void OnGUI()
{
if (GUI.Button(new Rect(5 * windowDpi, 5 * windowDpi, 110 * windowDpi, 35 * windowDpi), "Previous effect"))
{
Counter(-1);
}
if (GUI.Button(new Rect(120 * windowDpi, 5 * windowDpi, 110 * windowDpi, 35 * windowDpi), "Play again"))
{
Counter(0);
}
if (GUI.Button(new Rect(235 * windowDpi, 5 * windowDpi, 110 * windowDpi, 35 * windowDpi), "Next effect"))
{
Counter(+1);
}
StartColor = HueColor;
HueColor = GUI.HorizontalSlider(new Rect(5 * windowDpi, 45 * windowDpi, 340 * windowDpi, 35 * windowDpi), HueColor, 0, 1);
GUI.DrawTexture(new Rect(5 * windowDpi, 65 * windowDpi, 340 * windowDpi, 15 * windowDpi), HueTexture, ScaleMode.StretchToFill, false, 0);
if (HueColor != StartColor)
{
int i = 0;
foreach (var ps in particleSystems)
{
var main = ps.main;
Color colorHSV = Color.HSVToRGB(HueColor + H * 0, svList[i].S, svList[i].V);
main.startColor = new Color(colorHSV.r, colorHSV.g, colorHSV.b, svList[i].A);
i++;
}
}
}
private ParticleSystem[] particleSystems = new ParticleSystem[0];
private List<SVA> svList = new List<SVA>();
private float H;
public struct SVA
{
public float S;
public float V;
public float A;
}
void Counter(int count)
{
Prefab += count;
if (Prefab > Prefabs.Length - 1)
{
Prefab = 0;
}
else if (Prefab < 0)
{
Prefab = Prefabs.Length - 1;
}
if (Instance != null)
{
Destroy(Instance);
}
Instance = Instantiate(Prefabs[Prefab]);
particleSystems = Instance.GetComponentsInChildren<ParticleSystem>(); //Get color from current instance
svList.Clear();
foreach (var ps in particleSystems)
{
Color baseColor = ps.main.startColor.color;
SVA baseSVA = new SVA();
Color.RGBToHSV(baseColor, out H, out baseSVA.S, out baseSVA.V);
baseSVA.A = baseColor.a;
svList.Add(baseSVA);
}
}
void LateUpdate()
{
if (currDistance < 2)
{
currDistance = 2;
}
currDistance -= Input.GetAxis("Mouse ScrollWheel") * 2;
if (Holder && (Input.GetMouseButton(0) || Input.GetMouseButton(1)))
{
var pos = Input.mousePosition;
float dpiScale = 1;
if (Screen.dpi < 1) dpiScale = 1;
if (Screen.dpi < 200) dpiScale = 1;
else dpiScale = Screen.dpi / 200f;
if (pos.x < 380 * dpiScale && Screen.height - pos.y < 250 * dpiScale) return;
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
x += (float)(Input.GetAxis("Mouse X") * xRotate * 0.02);
y -= (float)(Input.GetAxis("Mouse Y") * yRotate * 0.02);
y = ClampAngle(y, yMinLimit, yMaxLimit);
var rotation = Quaternion.Euler(y, x, 0);
var position = rotation * new Vector3(0, 0, -currDistance) + Holder.position + cameraPos;
transform.rotation = rotation;
transform.position = position;
}
else
{
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
}
if (prevDistance != currDistance)
{
prevDistance = currDistance;
var rot = Quaternion.Euler(y, x, 0);
var po = rot * new Vector3(0, 0, -currDistance) + Holder.position + cameraPos;
transform.rotation = rot;
transform.position = po;
}
}
static float ClampAngle(float angle, float min, float max)
{
if (angle < -360)
{
angle += 360;
}
if (angle > 360)
{
angle -= 360;
}
return Mathf.Clamp(angle, min, max);
}
}

View File

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

View File

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