浏览代码

Added slash effect when player is triggering an attack (#356)

* Added slash effect when player is triggering an attack

* Corrected after merge from main

* renamed script to correct typing mistake

Co-authored-by: Amel Negra <amel.negra@unity3d.com>
/UI
GitHub 4 年前
当前提交
c20ffd23
共有 24 个文件被更改,包括 2092 次插入377 次删除
  1. 9
      UOP1_Project/Assets/Art/Characters/PigChef/Animation/CaneHit.anim
  2. 7
      UOP1_Project/Assets/Art/Characters/PigChef/Animation/CaneHit2.anim
  3. 52
      UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef.controller
  4. 608
      UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab
  5. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/ControlWalkingParticlesActionSO.cs
  6. 2
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/DestroyEntitySO.cs
  7. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayJumpParticlesActionSO.cs
  8. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLandParticlesActionSO.cs
  9. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLiftoffJumpParticlesActionSO.cs
  10. 8
      UOP1_Project/Assets/Art/Characters/PigChef/Effect.meta
  11. 87
      UOP1_Project/Assets/Scripts/Effects/PlayerEffectController.cs
  12. 134
      UOP1_Project/Assets/Shaders/Slash.shadergraph
  13. 10
      UOP1_Project/Assets/Shaders/Slash.shadergraph.meta
  14. 42
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.fbx
  15. 97
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.fbx.meta
  16. 100
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.png
  17. 116
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.png.meta
  18. 1001
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashEffect.prefab
  19. 7
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashEffect.prefab.meta
  20. 97
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashMaterial.mat
  21. 8
      UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashMaterial.mat.meta
  22. 68
      UOP1_Project/Assets/Scripts/Effects/DustParticlesController.cs
  23. 0
      /UOP1_Project/Assets/Scripts/Effects/PlayerEffectController.cs.meta

9
UOP1_Project/Assets/Art/Characters/PigChef/Animation/CaneHit.anim


m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events:
- time: 0.78333336
- time: 0.73333335
functionName: PlaySlashEffect
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
- time: 0.76666665
functionName: EnableWeapon
data:
objectReferenceParameter: {fileID: 0}

7
UOP1_Project/Assets/Art/Characters/PigChef/Animation/CaneHit2.anim


m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events:
- time: 0.8666667
functionName: PlayReverseSlashEffect
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
- time: 0.9166667
functionName: EnableWeapon
data:

52
UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef.controller


- {fileID: -4762902591384597963}
- {fileID: -2033464475531255411}
- {fileID: -890836485891151347}
- {fileID: 4588335210444503344}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0

m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &2953684125489925025
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: IsAttacking
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -450912674566187584}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.8943662
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &3444333041856388052
AnimatorState:
serializedVersion: 5

m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &4588335210444503344
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: IsAttacking
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5995182924539841906}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.8828125
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &4910209328142922604
AnimatorStateTransition:
m_ObjectHideFlags: 1

- {fileID: -3235251470832908421}
- {fileID: -1610815559573086160}
- {fileID: 5384281710731791955}
- {fileID: 2953684125489925025}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0

608
UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab
文件差异内容过多而无法显示
查看文件

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/ControlWalkingParticlesActionSO.cs


public class ControlWalkingParticlesAction : StateAction
{
//Component references
private DustParticlesController _dustController;
private PlayerEffectController _dustController;
_dustController = stateMachine.GetComponent<DustParticlesController>();
_dustController = stateMachine.GetComponent<PlayerEffectController>();
}
public override void OnStateEnter()

2
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/DestroyEntitySO.cs


public override void OnStateEnter()
{
GameObject.Destroy(_gameObject, 0.1f);
GameObject.Destroy(_gameObject);
}
}

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayJumpParticlesActionSO.cs


public class PlayJumpParticlesAction : StateAction
{
//Component references
private DustParticlesController _dustController;
private PlayerEffectController _dustController;
_dustController = stateMachine.GetComponent<DustParticlesController>();
_dustController = stateMachine.GetComponent<PlayerEffectController>();
}
public override void OnStateEnter()

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLandParticlesActionSO.cs


public class PlayLandParticlesAction : StateAction
{
//Component references
private DustParticlesController _dustController;
private PlayerEffectController _dustController;
private Transform _transform;
private float _coolDown = 0.3f;

public override void Awake(StateMachine stateMachine)
{
_dustController = stateMachine.GetComponent<DustParticlesController>();
_dustController = stateMachine.GetComponent<PlayerEffectController>();
_transform = stateMachine.transform;
}

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLiftoffJumpParticlesActionSO.cs


public class PlayLiftoffJumpParticlesAction : StateAction
{
//Component references
private DustParticlesController _dustController;
private PlayerEffectController _dustController;
_dustController = stateMachine.GetComponent<DustParticlesController>();
_dustController = stateMachine.GetComponent<PlayerEffectController>();
}
public override void OnStateEnter()

8
UOP1_Project/Assets/Art/Characters/PigChef/Effect.meta


fileFormatVersion: 2
guid: ae4a5245915efdb4aae02000a0246a54
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

87
UOP1_Project/Assets/Scripts/Effects/PlayerEffectController.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UOP1.StateMachine;
/// <summary>
/// Controls playback of particles connected to movement. Methods invoked by the StateMachine StateActions
/// </summary>
public class PlayerEffectController : MonoBehaviour
{
[SerializeField] ParticleSystem _walkingParticles = default;
[SerializeField] ParticleSystem _landParticles = default;
[SerializeField] ParticleSystem _jumpParticles = default;
[SerializeField] ParticleSystem _slashEffect = default;
[SerializeField] ParticleSystem _reverseSlashEffect = default;
private void Start()
{
_slashEffect.Stop();
_reverseSlashEffect.Stop();
}
public void EnableWalkParticles()
{
_walkingParticles.Play();
}
public void DisableWalkParticles()
{
_walkingParticles.Stop();
}
public void PlayJumpParticles()
{
_jumpParticles.Play();
}
public void PlayLandParticles()
{
_landParticles.Play();
}
public void PlaySlashEffect()
{
_slashEffect.Play();
}
public void PlayReverseSlashEffect()
{
_reverseSlashEffect.Play();
}
public void PlayLandParticles(float intensity)
{
// make sure intensity is always between 0 and 1
intensity = Mathf.Clamp01(intensity);
ParticleSystem.MainModule main = _landParticles.main;
ParticleSystem.MinMaxCurve origCurve = main.startSize; //save original curve to be assigned back to particle system
ParticleSystem.MinMaxCurve newCurve = main.startSize; //Make a new minMax curve and make our changes to the new copy
float minSize = newCurve.constantMin;
float maxSize = newCurve.constantMax;
// use the intensity to change the maximum size of the particle curve
newCurve.constantMax = Mathf.Lerp(minSize, maxSize, intensity);
main.startSize = newCurve;
_landParticles.Play();
// Put the original startSize back where you found it
StartCoroutine(ResetMinMaxCurve(_landParticles, origCurve));
// Note: We don't necessarily need to reset the curve, as it will be overridden
}
private IEnumerator ResetMinMaxCurve(ParticleSystem ps, ParticleSystem.MinMaxCurve curve)
{
while (ps.isEmitting)
{
yield return null;
}
ParticleSystem.MainModule main = ps.main;
main.startSize = curve;
}
}

134
UOP1_Project/Assets/Shaders/Slash.shadergraph
文件差异内容过多而无法显示
查看文件

10
UOP1_Project/Assets/Shaders/Slash.shadergraph.meta


fileFormatVersion: 2
guid: 426f8d984341c284296afedd5fa547fd
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

42
UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.fbx


Kaydara FBX Binary �MFBXHeaderExtension\FBXHeaderVersionI�x
FBXVersionI��EncryptionTypeI�CreationTimeStamp�VersionI��YearI��MonthIDayI'HourI?MinuteI$WSecondI
t MillisecondI��.CreatorS)Blender (stable FBX IO) - 2.90.1 - 4.21.3@' SceneInfoSGlobalInfoSceneInfoSUserData TypeSUserData7VersionIdMetaDataeVersionId|TitleS�SubjectS�AuthorS�KeywordsS�RevisionS�CommentS3 Properties70g9PS DocumentUrlSKStringSUrlSS /foobar.fbx�<PSSrcDocumentUrlSKStringSUrlSS /foobar.fbx�$PSOriginalSCompoundSS=LPSOriginal|ApplicationVendorSKStringSSSBlender Foundation�OPSOriginal|ApplicationNameSKStringSSSBlender (stable FBX IO)�APSOriginal|ApplicationVersionSKStringSSS2.90.1DMPSOriginal|DateTime_GMTSDateTimeSSS01/01/1970 00:00:00.000�<PSOriginal|FileNameSKStringSSS /foobar.fbx�%PS LastSavedSCompoundSSMPSLastSaved|ApplicationVendorSKStringSSSBlender FoundationzPPSLastSaved|ApplicationNameSKStringSSSBlender (stable FBX IO)�BPSLastSaved|ApplicationVersionSKStringSSS2.90.1&NPSLastSaved|DateTime_GMTSDateTimeSSS01/01/1970 00:00:00.000uFileIdR(�*��$�¿Ȱ*�+��� CreationTimeS1970-01-01 10:00:00:000�.CreatorS)Blender (stable FBX IO) - 2.90.1 - 4.21.3j GlobalSettings VersionI�] Properties70p)PSUpAxisSintSIntegerSI�-PS
UpAxisSignSintSIntegerSI�,PS FrontAxisSintSIntegerSI# 0PS FrontAxisSignSintSIntegerSI] ,PS CoordAxisSintSIntegerSI� 0PS CoordAxisSignSintSIntegerSI� 1PSOriginalUpAxisSintSIntegerSI����
5PSOriginalUpAxisSignSintSIntegerSIc
8PSUnitScaleFactorSdoubleSNumberSD�?�
@PSOriginalUnitScaleFactorSdoubleSNumberSD�? HPS AmbientColorSColorRGBSColorSDDDV APS DefaultCameraSKStringSSSProducer Perspective� %PSTimeModeSenumSSI � 3PS TimeSpanStartSKTimeSTimeSL
2PS TimeSpanStopSKTimeSTimeSL����
P 8PSCustomFrameRateSdoubleSNumberSD8@� Documents� CountI� DocumentL]�(SSceneSScened Properties70 &PS SourceObjectSobjectSSW 3PSActiveAnimStackNameSKStringSSS�  RootNodeL�
References�4 Definitions� VersionIdCountIV
ObjectTypeSGlobalSettingsICountI�
ObjectTypeSGeometry�CountI� PropertyTemplateSFbxMesh� Properties70"APSColorSColorRGBSColorSD�������?D�������?D�������?tDPSBBoxMinSVector3DSVectorSDDD�DPSBBoxMaxSVector3DSVectorSDDD/PSPrimary VisibilitySboolSSI;*PS Casts ShadowsSboolSSIu,PSReceive ShadowsSboolSSI?$
ObjectTypeSModel�CountI2$ PropertyTemplateSFbxNode%$ Properties70V2PSQuaternionInterpolateSenumSSI�KPSRotationOffsetSVector3DSVectorSDDDJPS RotationPivotSVector3DSVectorSDDD_JPS ScalingOffsetSVector3DSVectorSDDD�IPS ScalingPivotSVector3DSVectorSDDD�.PSTranslationActiveSboolSSIKKPSTranslationMinSVector3DSVectorSDDD�KPSTranslationMaxSVector3DSVectorSDDD�,PSTranslationMinXSboolSSI,PSTranslationMinYSboolSSIR,PSTranslationMinZSboolSSI�,PSTranslationMaxXSboolSSI�,PSTranslationMaxYSboolSSI,PSTranslationMaxZSboolSSI8*PS RotationOrderSenumSSI|6PSRotationSpaceForLimitOnlySboolSSI�;PSRotationStiffnessXSdoubleSNumberSD;PSRotationStiffnessYSdoubleSNumberSDW;PSRotationStiffnessZSdoubleSNumberSD�0PSAxisLenSdoubleSNumberSD$@�HPS PreRotationSVector3DSVectorSDDDBIPS PostRotationSVector3DSVectorSDDD{+PSRotationActiveSboolSSI�HPS RotationMinSVector3DSVectorSDDD'HPS RotationMaxSVector3DSVectorSDDD^)PS RotationMinXSboolSSI�)PS RotationMinYSboolSSI�)PS RotationMinZSboolSSI)PS RotationMaxXSboolSSI:)PS RotationMaxYSboolSSIq)PS RotationMaxZSboolSSI�(PS InheritTypeSenumSSI�*PS ScalingActiveSboolSSI4GPS
ScalingMinSVector3DSVectorSDDD�GPS
ScalingMaxSVector3DSVectorSD�?D�?D�?�(PS ScalingMinXSboolSSI�(PS ScalingMinYSboolSSI+(PS ScalingMinZSboolSSIa(PS ScalingMaxXSboolSSI�(PS ScalingMaxYSboolSSI�(PS ScalingMaxZSboolSSI,QPSGeometricTranslationSVector3DSVectorSDDD�NPSGeometricRotationSVector3DSVectorSDDD�MPSGeometricScalingSVector3DSVectorSD�?D�?D�?'6PS MinDampRangeXSdoubleSNumberSDk6PS MinDampRangeYSdoubleSNumberSD�6PS MinDampRangeZSdoubleSNumberSD�6PS MaxDampRangeXSdoubleSNumberSD76PS MaxDampRangeYSdoubleSNumberSD{6PS MaxDampRangeZSdoubleSNumberSD�9PSMinDampStrengthXSdoubleSNumberSD 9PSMinDampStrengthYSdoubleSNumberSDP9PSMinDampStrengthZSdoubleSNumberSD�9PSMaxDampStrengthXSdoubleSNumberSD�9PSMaxDampStrengthYSdoubleSNumberSD% 9PSMaxDampStrengthZSdoubleSNumberSDj 7PSPreferedAngleXSdoubleSNumberSD� 7PSPreferedAngleYSdoubleSNumberSD� 7PSPreferedAngleZSdoubleSNumberSD*!(PSLookAtPropertySobjectSSb!*PSUpVectorPropertySobjectSS�!!PSShowSboolSSI�!8PSNegativePercentShapeSupportSboolSSI"8PSDefaultAttributeIndexSintSIntegerSI����N"#PSFreezeSboolSSI"#PSLODBoxSboolSSI�"NPSLcl TranslationSLcl TranslationSSADDD1#HPS Lcl RotationS Lcl RotationSSADDD�#FPS Lcl ScalingS Lcl ScalingSSAD�?D�?D�?�#2PS
VisibilityS
VisibilitySSAD�?$EPSVisibility InheritanceSVisibility InheritanceSSI�+
ObjectTypeSMaterialz$CountI�+PropertyTemplateSFbxSurfacePhong�+ Properties70%1PS ShadingModelSKStringSSSPhong8%'PS
MultiLayerSboolSSI�%BPS EmissiveColorSColorSSADDD�%2PSEmissiveFactorSNumberSSAD�?&APS AmbientColorSColorSSAD�������?D�������?D�������?V&1PS AmbientFactorSNumberSSAD�?�&APS DiffuseColorSColorSSAD�������?D�������?D�������?�&1PS DiffuseFactorSNumberSSAD�?7'EPSTransparentColorSColorSSADDD{'6PSTransparencyFactorSNumberSSAD�'+PSOpacitySNumberSSAD�?(FPS NormalMapSVector3DSVectorSDDDW(APSBumpSVector3DSVectorSDDD�(3PS
BumpFactorSdoubleSNumberSD�?�(MPSDisplacementColorSColorRGBSColorSDDD<);PSDisplacementFactorSdoubleSNumberSD�?�)SPSVectorDisplacementColorSColorRGBSColorSDDD�)APSVectorDisplacementFactorSdoubleSNumberSD�?<*BPS SpecularColorSColorSSAD�������?D�������?D�������?|*2PSSpecularFactorSNumberSSAD�?�*-PS ShininessSNumberSSAD4@�*5PSShininessExponentSNumberSSAD4@L+DPSReflectionColorSColorSSADDD�+4PSReflectionFactorSNumberSSAD�?�0
ObjectTypeSTexture�+CountI�0PropertyTemplateSFbxFileTexture�0 Properties70q,+PSTextureTypeUseSenumSSI�,(PS AlphaSourceSenumSSI�,6PS Texture alphaSdoubleSNumberSD�?&--PSPremultiplyAlphaSboolSSIh-4PSCurrentTextureBlendModeSenumSSI�-/PSCurrentMappingTypeSenumSSI�-,PSUVSetSKStringSSSdefault.&PS WrapModeUSenumSSIG.&PS WrapModeVSenumSSIx.#PSUVSwapSboolSSI�.HPS TranslationSVector3DSVectorSDDD!/EPSRotationSVector3DSVectorSDDDs/DPSScalingSVector3DSVectorSD�?D�?D�?�/QPSTextureRotationPivotSVector3DSVectorSDDD00PPSTextureScalingPivotSVector3DSVectorSDDDf0(PS UseMaterialSboolSSI�0&PS UseMipMapSboolSSI�4
ObjectTypeSVideo�0CountI�4 PropertyTemplateSFbxVideo�4 Properties70r1(PSWidthSintSIntegerSI�1)PSHeightSintSIntegerSI�1'PSPathSKStringSUrlSS2'PS
AccessModeSenumSSIN2-PS
StartFrameSintSIntegerSI�2,PS StopFrameSintSIntegerSI�2,PSOffsetSKTimeSTimeSL32PS PlaySpeedSdoubleSNumberSD83(PS FreeRunningSboolSSIg3!PSLoopSboolSSI�3*PS InterlaceModeSenumSSI�3*PS ImageSequenceSboolSSI46PSImageSequenceOffsetSintSIntegerSI[42PS FrameRateSdoubleSNumberSD�4,PS LastFrameSintSIntegerSImIObjects�@&GeometryLf�3SPlaneGeometrySMesh>5 Properties70_5GeometryVersionI|Y7�Verticesdc�x]PMH�Q}��4n���"� V� ��j�P6��� ��� ֪AW>��APpW�苂�\�,�̅�E�Bq�`.2�E J����ze�l�=����w?c�[.��&�^3k�}��l�߻�_��^��X�؅v�X�K�z Vk�ŷ_g��+���|oVK:�Lͻ?�������F�[��l�Ʌ+�@� f�Xc��-d��{�Yaw�K�?^؉d��g^��v7�]4�`>�A�{+RH��a�g kXm�>���e:ğ�W���f�Z�����|�E/��{��V=}����{@�y��|I����@��/�FXV.�S{��>��l�R@�n孼���������S؃�iv�7I �8�q�}8~w��龶l6ξi�Ƙ��E�r���.�J�����Խ0�,E
���$�����{8�*�ґ>�ˑ��������Gr/~�� �B^I�υ������Q�M�q+��暕��䊼G}�nh���)�8�PolygonVertexIndexiP�x-�W
B1cE��������(���"H��| ��I !�Ѐ9<c��4a��� ����[ ~��� ��v�w`��ۋpǻ�[�x)�%y�ݽۇ-�n/��n=��D�O+8��<�`��۫p�Ǥ��x%��<��ޝ��R��G|F�M����Ra�8mEdgesi3`x Í
�`��o�"��iD����������.�j�mشe�Ȏ]{�8tdl�؉��Ssg�]�t�ڍ[ Kw��<x��ًWo�}���ۏ_��cr�;LayerElementNormalI�8VersionIe�8NameS#9MappingInformationTypeSByPolygonVertexS9 ReferenceInformationTypeSDirect�;~Normalsd�qx}�OhA������œl���R, ֤dݹ�ū��t@�ZSċ��R/B@E/�F)��TA+4�nk V�m���Q�6��� ��bޛ^?O�c�����!�h�;���q�_I��g�HE�>C*� �E���]}*`?�포Q�;'fIUi�}3q�F5����aN4i9����:.�ܙ&�� �u[���\|��wm��~��&�֛i�����q�M��p.��8&�s�rT���N�m� �A�;��"��܇��0��J\� V�]�̗S� �G�����;=f���c.�E���Ӽ�~Kϙ�'�Է��,���wR7�|̅rG���'�?\����B|�#��?]$��r������>p}���T?-E��3�L�)� �A%料 rQ?��eˏ
�׉
�Mof�r��%ܑ2��悹��$w��\�ip���G����;�Ns_j�'���_�w��+�Q;W~���A�Q��{�;�����#��|�Q}�<��['���i���+���z�ss��΅r��xE\�>�������8b*z�}�>�}��!�Sǻ�<���Mr��5��=��v����N����g�C��G����d��;��\�P��7�:����tH5� �"����;*�{���<V��ksm3Y>LayerElementUVI+<VersionIeF<
NameSUVMap}<MappingInformationTypeSByPolygonVertex�<ReferenceInformationTypeS IndexToDirect�=�UVdB�xUP�
BA<��7fEDDp�`�[¸�b3i��lf1�,ѠXAL��"gwf����9g"b��GSD��\�u��D_s�;�g����������� ����s#ż�vw�����Q���=� 1��ϰ/��Ͼ�'ݗ0棟�r����g�0�@�����[�K�C?=�M�3�|B=�G�/�C*� ?��$<�6��y�O�0O���B�}��AO��G��+L>�UVIndexiPxx-� �@�AApdQA����*i�*�61��
�8G_x�bs�?�፛����;n��~������7nv�#�ޮp��Co�� ��/�Ѽ�n�K4��;�����d?��7{�-)�H?LayerElementMaterialI�>VersionIe�>NameS�> MappingInformationTypeSAllSame?ReferenceInformationTypeS IndexToDirect;? Materialsi�@LayerIx?VersionId�? LayerElement�?TypeSLayerElementNormal�?
TypedIndexIH@ LayerElement@TypeSLayerElementUV;@
TypedIndexI�@ LayerElement�@TypeSLayerElementMaterial�@
TypedIndexI;B#ModelLˊ� S SlashModelSMeshAVersionI��A Properties70{A8PSDefaultAttributeIndexSintSIntegerSI�A(PS InheritTypeSenumSSI�A
MultiLayerI�A MultiTakeI BShadingC.BCullingS
CullingOff�E)MaterialLD 3SMaterial.001MaterialS�BVersionIf�B
ShadingModelSPhong�B
MultiLayerI�E Properties709CAPS DiffuseColorSColorSSAD����?D����?D����?�CAPS AmbientColorSColorSSAD@n �?D@n �?D@n �?�C1PS AmbientFactorSNumberSSADD3PS
BumpFactorSdoubleSNumberSDXDBPS SpecularColorSColorSSAD����?D����?D����?�D2PSSpecularFactorSNumberSSAD�?�D-PS ShininessSNumberSSAD9@E5PSShininessExponentSNumberSSAD9@hEDPSReflectionColorSColorSSAD����?D����?D����?�E4PSReflectionFactorSNumberSSAD�G.TextureL�� Sbase_color_textureTextureS,FTypeSTextureVideoClipEFVersionI�}F TextureNameSbase_color_textureTexture�FMediaSSlash.pngVideoGVFileNameSQC:\git_clones\open-project-1\UOP1_Project\Assets\Art\Characters\PigChef\Slash.png:GRelativeFilenameS Slash.png�G Properties70�G(PS UseMaterialSboolSSI`I'VideoL�SSlash.pngVideoSClip�G TypeSClip�H Properties70�HxPSPathSKStringSUrlSSQC:\git_clones\open-project-1\UOP1_Project\Assets\Art\Characters\PigChef\Slash.png�H UseMipMapI(IVFilenameSQC:\git_clones\open-project-1\UOP1_Project\Assets\Art\Characters\PigChef\Slash.pngSIRelativeFilenameS Slash.pngfJ Connections�ICSOOLˊ� L�ICSOOLf�3Lˊ� �ICSOOLD 3Lˊ� 2J*CSOPL�� LD 3S DiffuseColorYJCSOOL�L�� �JTakes�JCurrentS��� ���f�v���&~��Z�j���~�� �u�)

97
UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.fbx.meta


fileFormatVersion: 2
guid: 0fee20653a1148648abab46043da5f77
ModelImporter:
serializedVersion: 19301
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 0
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 1
useFileUnits: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15
secondaryUVHardAngle: 88
secondaryUVPackMargin: 8
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 0
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

100
UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.png

之前 之后
宽度: 128  |  高度: 512  |  大小: 25 KiB

116
UOP1_Project/Assets/Art/Characters/PigChef/Effect/Slash.png.meta


fileFormatVersion: 2
guid: 8c13366d54440e543a42887f5060a526
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
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: 1
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: WebGL
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:

1001
UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashEffect.prefab
文件差异内容过多而无法显示
查看文件

7
UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashEffect.prefab.meta


fileFormatVersion: 2
guid: a75f6395e1487b344a0ffafad66fc95a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

97
UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashMaterial.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SlashMaterial
m_Shader: {fileID: -6465566751694194690, guid: 426f8d984341c284296afedd5fa547fd,
type: 3}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- SHADOWCASTER
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- Texture2D_1730F8B5:
m_Texture: {fileID: 2800000, guid: 8c13366d54440e543a42887f5060a526, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 8c13366d54440e543a42887f5060a526, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
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}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 8c13366d54440e543a42887f5060a526, type: 3}
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}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaClip: 0
- _Blend: 1
- _BumpScale: 1
- _Cull: 0
- _Cutoff: 0.5
- _DstBlend: 10
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _QueueOffset: 0
- _ReceiveShadows: 1
- _SampleGI: 0
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 1
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0.96967727, b: 0.8537736, a: 0.69411767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _MainColor: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
--- !u!114 &1368590971718962234
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 2

8
UOP1_Project/Assets/Art/Characters/PigChef/Effect/SlashMaterial.mat.meta


fileFormatVersion: 2
guid: 514e8bd3e7d96c24e81a80aa87141fe7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

68
UOP1_Project/Assets/Scripts/Effects/DustParticlesController.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UOP1.StateMachine;
/// <summary>
/// Controls playback of particles connected to movement. Methods invoked by the StateMachine StateActions
/// </summary>
public class DustParticlesController : MonoBehaviour
{
[SerializeField] ParticleSystem _walkingParticles = default;
[SerializeField] ParticleSystem _landParticles = default;
[SerializeField] ParticleSystem _jumpParticles = default;
public void EnableWalkParticles()
{
_walkingParticles.Play();
}
public void DisableWalkParticles()
{
_walkingParticles.Stop();
}
public void PlayJumpParticles()
{
_jumpParticles.Play();
}
public void PlayLandParticles()
{
_landParticles.Play();
}
public void PlayLandParticles(float intensity)
{
// make sure intensity is always between 0 and 1
intensity = Mathf.Clamp01(intensity);
ParticleSystem.MainModule main = _landParticles.main;
ParticleSystem.MinMaxCurve origCurve = main.startSize; //save original curve to be assigned back to particle system
ParticleSystem.MinMaxCurve newCurve = main.startSize; //Make a new minMax curve and make our changes to the new copy
float minSize = newCurve.constantMin;
float maxSize = newCurve.constantMax;
// use the intensity to change the maximum size of the particle curve
newCurve.constantMax = Mathf.Lerp(minSize, maxSize, intensity);
main.startSize = newCurve;
_landParticles.Play();
// Put the original startSize back where you found it
StartCoroutine(ResetMinMaxCurve(_landParticles, origCurve));
// Note: We don't necessarily need to reset the curve, as it will be overridden
}
private IEnumerator ResetMinMaxCurve(ParticleSystem ps, ParticleSystem.MinMaxCurve curve)
{
while (ps.isEmitting)
{
yield return null;
}
ParticleSystem.MainModule main = ps.main;
main.startSize = curve;
}
}

/UOP1_Project/Assets/Scripts/Effects/DustParticlesController.cs.meta → /UOP1_Project/Assets/Scripts/Effects/PlayerEffectController.cs.meta

正在加载...
取消
保存