Commit 32ad6014 authored by Abdulrahman Mohammed's avatar Abdulrahman Mohammed

Done with tag system, NPCs and Scan System

parent 43a389bc
......@@ -39,7 +39,7 @@
"id": "852140f2-7766-474d-8707-702459ba45f3",
"expectedControlType": "",
"processors": "",
"interactions": "Hold",
"interactions": "",
"initialStateCheck": false
},
{
......@@ -237,6 +237,17 @@
"action": "Interact",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "681df2c6-357c-4162-8c8e-a57eeebf5aaa",
"path": "<Mouse>/rightButton",
"interactions": "",
"processors": "",
"groups": "",
"action": "Interact",
"isComposite": false,
"isPartOfComposite": false
}
]
}
......
......@@ -89,10 +89,10 @@ Material:
- _Surface: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 0.5019608}
- _BaseColor: {r: 1, g: 1, b: 1, a: 0.84705883}
- _BaseColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 0.5019608}
- _Color: {r: 1, g: 1, b: 1, a: 0.84705883}
- _ColorAddSubDiff: {r: 1, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 1.4285715, b: 0, a: 0}
......
......@@ -2,20 +2,24 @@
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2180264
Material:
serializedVersion: 6
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LiberationSans SDF Material
m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3}
m_ShaderKeywords:
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
......@@ -67,6 +71,7 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
......@@ -107,9 +112,9 @@ Material:
- _Parallax: 0.02
- _PerspectiveFilter: 0.875
- _Reflectivity: 10
- _ScaleRatioA: 0.90909094
- _ScaleRatioA: 0.9
- _ScaleRatioB: 0.73125
- _ScaleRatioC: 0.7386364
- _ScaleRatioC: 0.73125
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0
......@@ -148,6 +153,8 @@ Material:
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -161,11 +168,6 @@ MonoBehaviour:
m_Name: LiberationSans SDF - Fallback
m_EditorClassIdentifier:
m_Version: 1.1.0
m_Material: {fileID: 2180264}
m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Liberation Sans
......@@ -188,57 +190,8 @@ MonoBehaviour:
m_StrikethroughOffset: 18
m_StrikethroughThickness: 6.298828
m_TabWidth: 24
m_GlyphTable: []
m_CharacterTable: []
m_AtlasTextures:
- {fileID: 28268798066460806}
m_AtlasTextureIndex: 0
m_IsMultiAtlasTexturesEnabled: 1
m_ClearDynamicDataOnBuild: 1
m_UsedGlyphRects: []
m_FreeGlyphRects:
- m_X: 0
m_Y: 0
m_Width: 511
m_Height: 511
m_fontInfo:
Name: Liberation Sans
PointSize: 86
Scale: 1
CharacterCount: 250
LineHeight: 98.90625
Baseline: 0
Ascender: 77.84375
CapHeight: 59.1875
Descender: -18.21875
CenterLine: 0
SuperscriptOffset: 77.84375
SubscriptOffset: -12.261719
SubSize: 0.5
Underline: -12.261719
UnderlineThickness: 6.298828
strikethrough: 23.675
strikethroughThickness: 0
TabWidth: 239.0625
Padding: 9
AtlasWidth: 1024
AtlasHeight: 1024
atlas: {fileID: 0}
m_AtlasWidth: 512
m_AtlasHeight: 512
m_AtlasPadding: 9
m_AtlasRenderMode: 4169
m_glyphInfoList: []
m_KerningTable:
kerningPairs: []
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
fallbackFontAssets: []
m_FallbackFontAssetTable: []
m_Material: {fileID: 2180264}
m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
m_CreationSettings:
sourceFontFileName:
sourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
......@@ -258,6 +211,171 @@ MonoBehaviour:
fontStyleModifier: 0
renderMode: 4169
includeFontFeatures: 1
m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
m_SourceFontFilePath:
m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_GlyphTable: []
m_CharacterTable: []
m_AtlasTextures:
- {fileID: 28268798066460806}
m_AtlasTextureIndex: 0
m_IsMultiAtlasTexturesEnabled: 1
m_GetFontFeatures: 1
m_ClearDynamicDataOnBuild: 1
m_AtlasWidth: 512
m_AtlasHeight: 512
m_AtlasPadding: 9
m_AtlasRenderMode: 4169
m_UsedGlyphRects: []
m_FreeGlyphRects:
- m_X: 0
m_Y: 0
m_Width: 511
m_Height: 511
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords:
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -4.745117
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 3
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -6.3828125
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 55
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -6.3828125
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 57
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -3.1914062
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 58
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -6.3828125
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 60
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -1.5537109
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 89
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -1.5537109
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 90
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -1.5537109
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 92
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -6.3828125
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 2020
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
m_ShouldReimportFontFeatures: 0
m_FallbackFontAssetTable: []
m_FontWeightTable:
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
......@@ -306,6 +424,33 @@ MonoBehaviour:
boldSpacing: 7
italicStyle: 35
tabSize: 10
m_fontInfo:
Name: Liberation Sans
PointSize: 86
Scale: 1
CharacterCount: 250
LineHeight: 98.90625
Baseline: 0
Ascender: 77.84375
CapHeight: 59.1875
Descender: -18.21875
CenterLine: 0
SuperscriptOffset: 77.84375
SubscriptOffset: -12.261719
SubSize: 0.5
Underline: -12.261719
UnderlineThickness: 6.298828
strikethrough: 23.675
strikethroughThickness: 0
TabWidth: 239.0625
Padding: 9
AtlasWidth: 1024
AtlasHeight: 1024
m_glyphInfoList: []
m_KerningTable:
kerningPairs: []
fallbackFontAssets: []
atlas: {fileID: 0}
--- !u!28 &28268798066460806
Texture2D:
m_ObjectHideFlags: 0
......@@ -316,17 +461,21 @@ Texture2D:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 4
m_Width: 1
m_Height: 1
m_CompleteImageSize: 1
m_MipsStripped: 0
m_TextureFormat: 1
m_MipCount: 1
m_IsReadable: 1
m_IsPreProcessed: 0
m_IgnoreMipmapLimit: 0
m_MipmapLimitGroupName:
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_VTOnly: 0
m_AlphaIsTransparency: 0
m_ImageCount: 1
m_TextureDimension: 2
......@@ -340,9 +489,11 @@ Texture2D:
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_PlatformBlob:
image data: 1
_typelessdata: 00
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GunIdle
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path:
classID: 4
script: {fileID: 0}
flags: 0
m_EulerEditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path:
classID: 4
script: {fileID: 0}
flags: 0
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []
fileFormatVersion: 2
guid: 703743bb4abf412459a8134adb117a52
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -38,7 +38,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: CinemachineCamera/Gun
path:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
......@@ -51,7 +51,7 @@ AnimationClip:
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 2906380706
path: 0
attribute: 4
script: {fileID: 0}
typeID: 4
......@@ -90,7 +90,7 @@ AnimationClip:
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
......@@ -99,7 +99,7 @@ AnimationClip:
value: -360
inSlope: 0
outSlope: 0
tangentMode: 136
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
......@@ -107,10 +107,10 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: CinemachineCamera/Gun
path:
classID: 4
script: {fileID: 0}
flags: 16
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
......@@ -137,10 +137,10 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: CinemachineCamera/Gun
path:
classID: 4
script: {fileID: 0}
flags: 16
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
......@@ -167,10 +167,10 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: CinemachineCamera/Gun
path:
classID: 4
script: {fileID: 0}
flags: 16
flags: 0
m_EulerEditorCurves:
- serializedVersion: 2
curve:
......@@ -180,7 +180,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: CinemachineCamera/Gun
path:
classID: 4
script: {fileID: 0}
flags: 0
......@@ -192,7 +192,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: CinemachineCamera/Gun
path:
classID: 4
script: {fileID: 0}
flags: 0
......@@ -204,10 +204,10 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: CinemachineCamera/Gun
path:
classID: 4
script: {fileID: 0}
flags: 0
m_HasGenericRootTransform: 0
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-3911836230054889762
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Reload
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5612719048261548678}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-2041045070718815143
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: null
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 0}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Gun
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Reload
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 6561027432196677951}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &5522134262176306277
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -2041045070718815143}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &5612719048261548678
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GunReload
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 5522134262176306277}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 69889384bab668c4784c9509de3439f4, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &6561027432196677951
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 5612719048261548678}
m_Position: {x: 280, y: 0, z: 0}
- serializedVersion: 1
m_State: {fileID: -2041045070718815143}
m_Position: {x: 240, y: 120, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: -3911836230054889762}
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 470, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -2041045070718815143}
fileFormatVersion: 2
guid: c247c09c4b221134090aabedfe185920
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
......@@ -204,13 +204,14 @@ GameObject:
- component: {fileID: 2676458933401633030}
- component: {fileID: 5801320409247430128}
- component: {fileID: 7910418901260518363}
- component: {fileID: 1845268294113052234}
- component: {fileID: 8599590187290476828}
- component: {fileID: 3715518179017488439}
- component: {fileID: 7513684002663440767}
- component: {fileID: 1845268294113052234}
- component: {fileID: 3715518179017488439}
- component: {fileID: 4577948788861265325}
- component: {fileID: 7439170055329331585}
m_Layer: 0
- component: {fileID: 3134386485418195282}
m_Layer: 3
m_Name: Elephant
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -380,25 +381,6 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!114 &1845268294113052234
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 717743728087204625}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0ca804d6b18f6d4db4ebe14203336f1, type: 3}
m_Name:
m_EditorClassIdentifier:
animalSound: {fileID: 8300000, guid: 577532471b3374967adb1ff2620e2761, type: 3}
walking: {fileID: 8300000, guid: 612962daa1f8842159872a600c011bd4, type: 3}
eating: {fileID: 0}
running: {fileID: 8300000, guid: de958d1389c5f4943b29af6a49318cad, type: 3}
attacking: {fileID: 8300000, guid: 7a306e42ceac44633878fcd02509d204, type: 3}
death: {fileID: 8300000, guid: a231c712d73334749af731ed7a2ea067, type: 3}
sleeping: {fileID: 0}
--- !u!136 &8599590187290476828
CapsuleCollider:
m_ObjectHideFlags: 0
......@@ -422,6 +404,47 @@ CapsuleCollider:
m_Height: 9.87
m_Direction: 2
m_Center: {x: 0, y: 3.83, z: 0.87}
--- !u!195 &7513684002663440767
NavMeshAgent:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 717743728087204625}
m_Enabled: 1
m_AgentTypeID: 0
m_Radius: 0.5
m_Speed: 3.5
m_Acceleration: 8
avoidancePriority: 50
m_AngularSpeed: 120
m_StoppingDistance: 0
m_AutoTraverseOffMeshLink: 1
m_AutoBraking: 1
m_AutoRepath: 1
m_Height: 2
m_BaseOffset: 0
m_WalkableMask: 4294967295
m_ObstacleAvoidanceType: 4
--- !u!114 &1845268294113052234
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 717743728087204625}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0ca804d6b18f6d4db4ebe14203336f1, type: 3}
m_Name:
m_EditorClassIdentifier:
animalSound: {fileID: 8300000, guid: 577532471b3374967adb1ff2620e2761, type: 3}
walking: {fileID: 8300000, guid: 612962daa1f8842159872a600c011bd4, type: 3}
eating: {fileID: 0}
running: {fileID: 8300000, guid: de958d1389c5f4943b29af6a49318cad, type: 3}
attacking: {fileID: 8300000, guid: 7a306e42ceac44633878fcd02509d204, type: 3}
death: {fileID: 8300000, guid: a231c712d73334749af731ed7a2ea067, type: 3}
sleeping: {fileID: 0}
--- !u!114 &3715518179017488439
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -484,28 +507,6 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
CurrentState: 0
--- !u!195 &7513684002663440767
NavMeshAgent:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 717743728087204625}
m_Enabled: 1
m_AgentTypeID: 0
m_Radius: 0.5
m_Speed: 3.5
m_Acceleration: 8
avoidancePriority: 50
m_AngularSpeed: 120
m_StoppingDistance: 0
m_AutoTraverseOffMeshLink: 1
m_AutoBraking: 1
m_AutoRepath: 1
m_Height: 2
m_BaseOffset: 0
m_WalkableMask: 4294967295
m_ObstacleAvoidanceType: 4
--- !u!114 &4577948788861265325
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -549,6 +550,27 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::AnimalDetails
<animalProperties>k__BackingField: {fileID: 11400000, guid: 9c4c9c8f3b059674d8ea903f0baa73f1, type: 2}
--- !u!65 &3134386485418195282
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 717743728087204625}
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: 3.7020752, y: 7.6251206, z: 9.196465}
m_Center: {x: 0, y: 3.9071233, z: 1.1254215}
--- !u!1 &821623542764607179
GameObject:
m_ObjectHideFlags: 0
......@@ -1533,7 +1555,7 @@ GameObject:
- component: {fileID: 9070904445842527667}
- component: {fileID: 1162822430167826458}
- component: {fileID: 3464383437824832733}
m_Layer: 3
m_Layer: 6
m_Name: Head
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -1921,7 +1943,7 @@ GameObject:
- component: {fileID: 1801785662801669232}
- component: {fileID: 8763564027534688949}
- component: {fileID: 3160737932670797696}
m_Layer: 3
m_Layer: 6
m_Name: Body
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -1937,7 +1959,7 @@ Transform:
m_GameObject: {fileID: 5608530374267735661}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 4.94, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
......@@ -1965,7 +1987,7 @@ CapsuleCollider:
m_Radius: 1.96
m_Height: 7.300329
m_Direction: 2
m_Center: {x: 0, y: 4.94, z: -0.48516464}
m_Center: {x: 0, y: 0, z: -0.48516464}
--- !u!114 &3160737932670797696
MonoBehaviour:
m_ObjectHideFlags: 0
......
This diff is collapsed.
fileFormatVersion: 2
guid: 6fa0ced277d385a4b9b39917cd3ed929
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ad9373ab1badff849b73b602fe5262af, type: 3}
m_Name: Easy
m_EditorClassIdentifier: Assembly-CSharp::NPCsProperties
<MovementSpeed>k__BackingField: 3.5
<patrolRange>k__BackingField: 20
<AttackRange>k__BackingField: 10
<TimeBetweenShoot>k__BackingField: 0.5
<StillFollowAnimal>k__BackingField: 1
<NumberOfShootIncorrectAnimals>k__BackingField: 0
fileFormatVersion: 2
guid: 2f13169c00189e44680aabe084174178
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
public enum AnimalName
public enum AnimalName
{
// Ice
Penguin,
......@@ -15,7 +15,9 @@ public enum AnimalName
// Desert
SnakeRed,
Ostrich
Ostrich,
ثعلب
}
public enum AnimalType
......@@ -56,4 +58,5 @@ public enum AnimalPart
{
Body,
Head
}
\ No newline at end of file
}
......@@ -125,7 +125,7 @@ public partial class @InputSystem: IInputActionCollection2, IDisposable
""id"": ""852140f2-7766-474d-8707-702459ba45f3"",
""expectedControlType"": """",
""processors"": """",
""interactions"": ""Hold"",
""interactions"": """",
""initialStateCheck"": false
},
{
......@@ -323,6 +323,17 @@ public partial class @InputSystem: IInputActionCollection2, IDisposable
""action"": ""Interact"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""681df2c6-357c-4162-8c8e-a57eeebf5aaa"",
""path"": ""<Mouse>/rightButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Interact"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
......
using UnityEngine;
public class TagGeneration : MonoBehaviour
{
[SerializeField] AnimalProperties[] ForestAnimals;
[SerializeField] AnimalProperties[] IceAnimals;
[SerializeField] AnimalProperties[] DesertAnimals;
private void Start()
{
GenerationTags(2);
}
public void GenerationTags(int tagCount)
{
}
}
using UnityEngine;
[CreateAssetMenu(menuName = "Scriptable Objects/NPCsProperties")]
public class NPCsProperties : ScriptableObject
{
[field: SerializeField] public float MovementSpeed { get; private set; }
[field: SerializeField] public float patrolRange { get; private set; }
[field: SerializeField] public float AttackRange { get; private set; }
[field: SerializeField] public float TimeBetweenShoot { get; private set; }
[field: SerializeField] public bool StillFollowAnimal { get; private set; }
[field: SerializeField] public int NumberOfShootIncorrectAnimals { get; private set; }
}
fileFormatVersion: 2
guid: ad9373ab1badff849b73b602fe5262af
\ No newline at end of file
......@@ -7,6 +7,7 @@ using UnityEngine;
public class MatchManager : MonoBehaviour
{
[SerializeField] Transform animalsParent;
[SerializeField] Transform npcParent;
[SerializeField] TransitionSettings transitionSettings;
[SerializeField] TextMeshProUGUI roundTimerText;
[SerializeField] TextMeshProUGUI matchRoundText;
......@@ -38,12 +39,14 @@ public class MatchManager : MonoBehaviour
{
currentMatch++;
DestroyAnimals();
StopNPC(true);
_transitionManager.onTransitionCutPointReached += ChangeRound;
_transitionManager.Transition(transitionSettings, 1);
}
else
{
DestroyAnimals();
StopNPC(true);
_transitionManager.Transition("MainMenu", transitionSettings, 1);
}
......@@ -51,6 +54,7 @@ public class MatchManager : MonoBehaviour
void ChangeRound()
{
animalsSpawner.SpawnAnimals();
StopNPC(false);
matchRoundText.text = $"Round: {currentMatch}/{maxMatchRound}";
currentTimer = maxRoundTimer;
StartCoroutine(startTimer());
......@@ -63,4 +67,11 @@ public class MatchManager : MonoBehaviour
animal.EndRound();
}
}
void StopNPC(bool status)
{
foreach (NPCsMovement npc in npcParent.GetComponentsInChildren<NPCsMovement>())
{
npc.EndRound(status);
}
}
}
using System;
using System.Collections.Generic;
using UnityEngine;
public class AnimalDetails : MonoBehaviour
{
[field: SerializeField] public AnimalProperties animalProperties { get; private set; }
[field: SerializeField] public AnimalProperties animalProperties { get; private set; }
[SerializeField] List<Enum> animalTag = new List<Enum>();
[SerializeField] bool isCorrect;
private void Start()
{
AddAnimalTagsToList();
Invoke("CheckIfAnimalIsCorrect", .1f);
}
void AddAnimalTagsToList()
{
animalTag.Add(animalProperties.AnimalType);
animalTag.Add(animalProperties.FoodType);
animalTag.Add(animalProperties.Environment);
animalTag.Add(animalProperties.SpecialAbilities);
animalTag.Add(animalProperties.Reproduction);
}
public void CheckIfAnimalIsCorrect()
{
isCorrect = true;
foreach (Enum tag in AnimalsQuestionGenerator.Instance.randomTags)
{
if (!animalTag.Contains(tag))
{
isCorrect = false;
break;
}
}
}
}
......@@ -7,7 +7,7 @@ public class AnimalsSpawner : MonoBehaviour
[SerializeField] float spawnRadius;
[SerializeField] int animalsCount;
[SerializeField] Transform animalsParent;
[SerializeField] bool debugMode;
void Start()
{
SpawnAnimals();
......@@ -26,9 +26,12 @@ public class AnimalsSpawner : MonoBehaviour
}
}
}
private void OnDrawGizmos()
void OnDrawGizmos()
{
Gizmos.color = Color.red;
Gizmos.DrawSphere(transform.position, spawnRadius);
if (debugMode)
{
Gizmos.color = Color.red;
Gizmos.DrawSphere(transform.position, spawnRadius);
}
}
}
......@@ -37,9 +37,7 @@ public class Health : MonoBehaviour
isDie = true;
if (firstPlayer == lastPlayer)
{
firstPlayer.AddScore((int)healthSlider.maxValue);
}
else
lastPlayer.AddScore((int)healthSlider.maxValue / 2);
......
fileFormatVersion: 2
guid: dddc0cbaa1d7f4b4da243f69709934b9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using Unity.VisualScripting;
using UnityEngine;
public class NPCsFire : MonoBehaviour
{
[SerializeField] Transform gunParent;
[SerializeField] float rotationSpeed;
NPCsMovement _NPCsMovement;
RaycastWeapon _raycastWeapon;
float _lastShootTime;
Collider _animal;
void Start()
{
_NPCsMovement = GetComponent<NPCsMovement>();
_NPCsMovement.animal += ShootAniaml;
_raycastWeapon = GetComponent<RaycastWeapon>();
}
private void ShootAniaml(Collider collider)
{
_animal = collider;
}
private void Update()
{
if (_animal != null)
{
LookAtAnimal();
if (Time.time > _lastShootTime)
{
_raycastWeapon.Fire(gunParent.forward);
_lastShootTime = Time.time + _NPCsMovement.npcsProperties.TimeBetweenShoot;
}
}
else
gunParent.localRotation = Quaternion.Slerp(gunParent.localRotation, Quaternion.identity, Time.deltaTime * rotationSpeed);
}
void LookAtAnimal()
{
Vector3 direction = _animal.transform.position - transform.position;
Vector3 bodyDirection = direction;
bodyDirection.y = 0;
if (direction != Vector3.zero)
{
Quaternion bodyRotation = Quaternion.LookRotation(bodyDirection);
transform.rotation = Quaternion.Slerp(transform.rotation, bodyRotation, Time.deltaTime * rotationSpeed);
Quaternion gunRotation = Quaternion.LookRotation(direction);
gunParent.rotation = Quaternion.Slerp(gunParent.rotation, gunRotation, Time.deltaTime * rotationSpeed);
}
}
}
fileFormatVersion: 2
guid: af453fbcf25350a4cae216c2b55c70ef
\ No newline at end of file
using System;
using UnityEngine;
using UnityEngine.AI;
public class NPCsMovement : MonoBehaviour
{
[field: SerializeField] public NPCsProperties npcsProperties { get; private set; }
public event Action<Collider> animal;
[SerializeField] LayerMask animalLayer;
[SerializeField] bool debugMode;
NavMeshAgent _agent;
Vector3 _direction;
[SerializeField] Collider[] animalsCollider = new Collider[3];
[SerializeField] Collider _currentTarget;
void Start()
{
_agent = GetComponent<NavMeshAgent>();
_agent.SetDestination(GetNewPoint());
_agent.speed = npcsProperties.MovementSpeed;
}
void Update()
{
CheckTarget();
if (_currentTarget == null)
{
if (_agent.remainingDistance <= _agent.stoppingDistance)
_agent.SetDestination(GetNewPoint());
}
else
{
if (npcsProperties.StillFollowAnimal)
_agent.SetDestination(_currentTarget.transform.position);
else
_agent.SetDestination(transform.position);
}
}
void CheckTarget()
{
int colliders = Physics.OverlapSphereNonAlloc(transform.position, npcsProperties.AttackRange, animalsCollider, animalLayer);
if (colliders > 0)
{
if (_currentTarget != animalsCollider[0])
{
_currentTarget = animalsCollider[0];
animal?.Invoke(_currentTarget);
}
return;
}
animal?.Invoke(null);
_currentTarget = null;
}
Vector3 GetNewPoint()
{
_direction = transform.position + UnityEngine.Random.insideUnitSphere * npcsProperties.patrolRange;
_direction.y = 0;
if (NavMesh.SamplePosition(_direction, out NavMeshHit hit, 2, NavMesh.AllAreas))
{
return hit.position;
}
return transform.position;
}
void OnDrawGizmos()
{
if (debugMode)
{
Gizmos.color = Color.green;
Gizmos.DrawSphere(transform.position, npcsProperties.patrolRange);
Gizmos.color = Color.red;
Gizmos.DrawSphere(transform.position, npcsProperties.AttackRange);
}
}
public void EndRound(bool status)
{
_agent.isStopped = status;
}
}
fileFormatVersion: 2
guid: 4676933a8cb5b9c47b3fba61a982af83
\ No newline at end of file
using System;
using UnityEngine;
public class ScanAnimals : MonoBehaviour
{
[SerializeField] LayerMask animalLayer;
[SerializeField] TypewriterEffect TextPanel;
[SerializeField] ParticleSystem scanParticle;
InputManager _inputManager;
Camera _cam;
void Start()
{
_inputManager = InputManager.Instance;
_cam = Camera.main;
}
void Update()
{
if (_inputManager.Interact)
{
if (Physics.Raycast(transform.position, _cam.transform.forward, out RaycastHit hit, 100, animalLayer))
{
if (hit.collider.TryGetComponent<AnimalDetails>(out AnimalDetails animalDetails))
{
if(!scanParticle.isPlaying) scanParticle.Play();
TextPanel.ShowAnimalDetails(animalDetails);
}
}
}
else
{
if (scanParticle.isPlaying) scanParticle.Stop();
TextPanel.HideText();
}
}
}
fileFormatVersion: 2
guid: ae61e2e924e402846aa75be26b8a1790
\ No newline at end of file
......@@ -6,16 +6,17 @@ public class Score : MonoBehaviour
[SerializeField] int score;
[SerializeField] TextMeshProUGUI scoreText;
RaycastWeapon _raycastWeapon;
void Start()
{
_raycastWeapon = GetComponent<RaycastWeapon>();
_raycastWeapon.onAnimalDie += AnimalDie;
_raycastWeapon.onAnimalDie += AnimalDie;
}
private void AnimalDie(int score)
{
this.score += score;
scoreText.text = "Score: " + score.ToString();
if (scoreText != null)
scoreText.text = "Score: " + this.score.ToString();
}
}
fileFormatVersion: 2
guid: 4a26dcdccca78c044bd386f7796558cb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TMPro;
using UnityEngine;
public class AnimalsQuestionGenerator : MonoBehaviour
{
public static AnimalsQuestionGenerator Instance { get; private set; }
public List<Enum> randomTags { get; private set; } = new List<Enum>();
[SerializeField] TextMeshProUGUI QuestionText;
[SerializeField] StringBuilder text = new StringBuilder();
private void Awake()
{
if (Instance == null)
Instance = this;
else
Destroy(this);
}
private void Start()
{
GengenerateNewQuestions();
}
public void GengenerateNewQuestions()
{
do
{
AddRandomTagToList();
}
while (CheckIfTagsIsCorrect() == false);
text.Clear();
for (int i = 0; i < randomTags.Count; i++)
{
text.Append(randomTags[i].ToString());
if (i != randomTags.Count - 1)
text.Append(" And ");
}
Debug.Log(text);
}
private void AddRandomTagToList()
{
randomTags.Clear();
var AnimalType = (AnimalType[])Enum.GetValues(typeof(AnimalType));
randomTags.Add(AnimalType[UnityEngine.Random.Range(0, AnimalType.Length)]);
var FoodType = (FoodType[])Enum.GetValues(typeof(FoodType));
randomTags.Add(FoodType[UnityEngine.Random.Range(0, FoodType.Length)]);
//var Environment = (Environment[])Enum.GetValues(typeof(Environment));
//randomTags.Add(Environment[UnityEngine.Random.Range(0, Environment.Length)]);
//var SpecialAbilities = (SpecialAbilities[])Enum.GetValues(typeof(SpecialAbilities));
//randomTags.Add(SpecialAbilities[UnityEngine.Random.Range(0, SpecialAbilities.Length)]);
//var Reproduction = (Reproduction[])Enum.GetValues(typeof(Reproduction));
//randomTags.Add(Reproduction[UnityEngine.Random.Range(0, Reproduction.Length)]);
}
bool CheckIfTagsIsCorrect()
{
if (randomTags.Contains(AnimalType.Bird) && randomTags.Contains(Reproduction.LiveBirth))
return false;
if (randomTags.Contains(AnimalType.Mammal) && randomTags.Contains(Reproduction.LaysEggs))
return false;
if (randomTags.Contains(AnimalType.Mammal) && randomTags.Contains(SpecialAbilities.Venomous))
return false;
if (randomTags.Contains(Environment.Desert) && randomTags.Contains(SpecialAbilities.CanSwim))
return false;
if (randomTags.Contains(Environment.Ice) && !randomTags.Contains(SpecialAbilities.CanSwim))
return false;
if (randomTags.Contains(Environment.Ice) && !randomTags.Contains(SpecialAbilities.CanRun))
return false;
if (randomTags.Contains(Environment.Ice) && randomTags.Contains(SpecialAbilities.Venomous))
return false;
return true;
}
}
\ No newline at end of file
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using DG.Tweening;
public class TypewriterEffect : MonoBehaviour
{
[SerializeField] float typeDuration;
[SerializeField] List<AnimalProperties> animalDetailsList = new List<AnimalProperties>();
TextMeshProUGUI _textMeshProUGUI;
AnimalDetails _currentAnimal;
Tween currentTween;
void Start()
{
_textMeshProUGUI = GetComponent<TextMeshProUGUI>();
}
public void ShowAnimalDetails(AnimalDetails animalDetails)
{
if (_currentAnimal == animalDetails) return;
_currentAnimal = animalDetails;
if (!animalDetailsList.Contains(animalDetails.animalProperties))
{
animalDetailsList.Add(animalDetails.animalProperties);
WriteText(animalDetails);
_textMeshProUGUI.maxVisibleCharacters = 0;
currentTween = DOTween.To(() => _textMeshProUGUI.maxVisibleCharacters, x => _textMeshProUGUI.maxVisibleCharacters = x, _textMeshProUGUI.text.Length, typeDuration)
.SetEase(Ease.Linear);
}
else
{
WriteText(animalDetails);
_textMeshProUGUI.maxVisibleCharacters = _textMeshProUGUI.text.Length;
}
}
void WriteText(AnimalDetails animalDetails)
{
_textMeshProUGUI.text = $"Name: {animalDetails.animalProperties.name} + AnimalType: {animalDetails.animalProperties.AnimalType} + FoodType: {animalDetails.animalProperties.FoodType} + Enviroment: {animalDetails.animalProperties.Environment}";
}
public void HideText()
{
_currentAnimal = null;
_textMeshProUGUI.text = " ";
if (currentTween != null && currentTween.IsActive())
currentTween.Kill();
}
private void OnDestroy()
{
DOTween.Kill(_textMeshProUGUI);
}
}
fileFormatVersion: 2
guid: 84b93be8b094c514481958dcc623747a
\ No newline at end of file
......@@ -11,7 +11,6 @@ public class RaycastWeapon : MonoBehaviour
[Header("Raycast Settings")]
[SerializeField] float range;
[SerializeField] int maxAmmo;
[SerializeField] float fireRateInSecond;
[SerializeField] float reloadTime;
[SerializeField] LayerMask bodyPartLayer;
[SerializeField] ParticleSystem MuzzleFlashEffect;
......@@ -21,9 +20,8 @@ public class RaycastWeapon : MonoBehaviour
[SerializeField] int BodyDamage;
Animator _animator;
[SerializeField] Animator gunAnimator;
float _lastFireTime;
int _currentAmmo;
bool isReloading;
......@@ -33,7 +31,6 @@ public class RaycastWeapon : MonoBehaviour
private void Start()
{
_currentAmmo = maxAmmo;
_animator = GetComponent<Animator>();
}
public void Fire(Vector3 dir)
{
......@@ -79,11 +76,11 @@ public class RaycastWeapon : MonoBehaviour
IEnumerator ReloadRoutine()
{
isReloading = true;
_animator.SetTrigger("Reload");
gunAnimator.SetTrigger("Reload");
yield return null;
while (_animator.GetCurrentAnimatorStateInfo(0).normalizedTime < .95f)
while (gunAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime < .95f)
{
yield return null;
}
......@@ -96,6 +93,5 @@ public class RaycastWeapon : MonoBehaviour
public void AddScore(int score)
{
onAnimalDie?.Invoke(score);
Debug.Log(score);
}
}
......@@ -11,7 +11,7 @@ TagManager:
- Animal
- Water
- UI
-
- AnimalParts
-
-
-
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment