add
This commit is contained in:
parent
81549fdb3d
commit
d929c18bc3
@ -503,7 +503,7 @@ AnimatorStateTransition:
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.8469388
|
||||
m_HasExitTime: 1
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
@ -800,7 +800,7 @@ AnimatorStateTransition:
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.95481926
|
||||
m_HasExitTime: 1
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
@ -978,7 +978,7 @@ AnimatorStateTransition:
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.765625
|
||||
m_HasExitTime: 1
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
|
@ -56,14 +56,7 @@ ModelImporter:
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events:
|
||||
- time: 0
|
||||
functionName: OperateClick
|
||||
data:
|
||||
objectReferenceParameter: {fileID: 2548037664796076872, guid: 9e4797c6e2ce28c4a9d37a399f4151e2, type: 3}
|
||||
floatParameter: 0
|
||||
intParameter: 0
|
||||
messageOptions: 0
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 3
|
||||
maskSource: {instanceID: 0}
|
||||
|
53
xiaofang/Assets/Resources/Ain/PromptAnim.anim
Normal file
53
xiaofang/Assets/Resources/Ain/PromptAnim.anim
Normal file
@ -0,0 +1,53 @@
|
||||
%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: PromptAnim
|
||||
serializedVersion: 7
|
||||
m_Legacy: 1
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves: []
|
||||
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: []
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 1
|
||||
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: []
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
8
xiaofang/Assets/Resources/Ain/PromptAnim.anim.meta
Normal file
8
xiaofang/Assets/Resources/Ain/PromptAnim.anim.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7012e3de65d9c6745a7751b1ca0b63aa
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
17562
xiaofang/Assets/Resources/Character/Testhuman.prefab
Normal file
17562
xiaofang/Assets/Resources/Character/Testhuman.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 006066e2380528243a52cbfc56f6d189
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
xiaofang/Assets/Resources/Character/ts.fbx
Normal file
BIN
xiaofang/Assets/Resources/Character/ts.fbx
Normal file
Binary file not shown.
107
xiaofang/Assets/Resources/Character/ts.fbx.meta
Normal file
107
xiaofang/Assets/Resources/Character/ts.fbx.meta
Normal file
@ -0,0 +1,107 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6bc7df1154100349849cd46c04a4a62
|
||||
ModelImporter:
|
||||
serializedVersion: 21300
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
materials:
|
||||
materialImportMode: 2
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
removeConstantScaleCurves: 1
|
||||
motionNodeName:
|
||||
rigImportErrors:
|
||||
rigImportWarnings:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 3
|
||||
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
|
||||
nodeNameCollisionStrategy: 1
|
||||
fileIdsGeneration: 2
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
bakeAxisConversion: 0
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
optimizeBones: 1
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVMarginMethod: 1
|
||||
secondaryUVMinLightmapResolution: 40
|
||||
secondaryUVMinObjectScale: 1
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
strictVertexDataChecks: 0
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 1
|
||||
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: 1
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 3
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 1
|
||||
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
|
||||
remapMaterialsIfMaterialImportModeIsNone: 0
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
xiaofang/Assets/Resources/UIPrefab.meta
Normal file
8
xiaofang/Assets/Resources/UIPrefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 975f179178f1e684a9a308c08c1453f2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
175
xiaofang/Assets/Resources/UIPrefab/PromptBg.prefab
Normal file
175
xiaofang/Assets/Resources/UIPrefab/PromptBg.prefab
Normal file
@ -0,0 +1,175 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1785748703130119632
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1489606417511801867}
|
||||
- component: {fileID: 2376682574940800023}
|
||||
- component: {fileID: 6540794357833201727}
|
||||
- component: {fileID: 9194197327704083339}
|
||||
m_Layer: 5
|
||||
m_Name: PromptBg
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1489606417511801867
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1785748703130119632}
|
||||
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:
|
||||
- {fileID: 6579371435786621728}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
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: 44.7935, y: -0.36}
|
||||
m_SizeDelta: {x: 189.587, y: 84.1619}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2376682574940800023
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1785748703130119632}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6540794357833201727
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1785748703130119632}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 21300000, guid: 9d826dee5aabb5f41b0fececa4da297f, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!111 &9194197327704083339
|
||||
Animation:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1785748703130119632}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Animation: {fileID: 0}
|
||||
m_Animations: []
|
||||
m_WrapMode: 0
|
||||
m_PlayAutomatically: 1
|
||||
m_AnimatePhysics: 0
|
||||
m_CullingType: 0
|
||||
--- !u!1 &3089870660448800777
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6579371435786621728}
|
||||
- component: {fileID: 1895679197264623351}
|
||||
- component: {fileID: 474207888690219694}
|
||||
m_Layer: 5
|
||||
m_Name: PromptText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6579371435786621728
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3089870660448800777}
|
||||
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: 1489606417511801867}
|
||||
m_RootOrder: 0
|
||||
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: -0.0001, y: -1.3269}
|
||||
m_SizeDelta: {x: 159.9999, y: 52.5609}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1895679197264623351
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3089870660448800777}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &474207888690219694
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3089870660448800777}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: New Text
|
7
xiaofang/Assets/Resources/UIPrefab/PromptBg.prefab.meta
Normal file
7
xiaofang/Assets/Resources/UIPrefab/PromptBg.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6025bf38a7ada134281ba43ad08c154b
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
8
xiaofang/Assets/Scenes/qiuren.meta
Normal file
8
xiaofang/Assets/Scenes/qiuren.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a47282735ffc71f429e0c3d9042954ca
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
BIN
xiaofang/Assets/Scenes/qiuren/NavMesh.asset
Normal file
BIN
xiaofang/Assets/Scenes/qiuren/NavMesh.asset
Normal file
Binary file not shown.
8
xiaofang/Assets/Scenes/qiuren/NavMesh.asset.meta
Normal file
8
xiaofang/Assets/Scenes/qiuren/NavMesh.asset.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d3ce950d6afb6e4285fa96ac520464d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 23800000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -10,8 +10,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
private Button connectgun;//连接水枪按钮
|
||||
private Button connectfa;//连接水阀按钮
|
||||
private Button openfa;//打开水阀按钮
|
||||
//private Image Timermusk;
|
||||
//private Text TimerText;
|
||||
|
||||
|
||||
private CharacterAin Characterain;
|
||||
|
||||
@ -19,6 +18,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
|
||||
public GameObject cha;
|
||||
public GameObject xfs;
|
||||
|
||||
private GameObject timer;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@ -30,8 +30,6 @@ public class CharacterInturn : MonoBehaviour
|
||||
connectgun = GameObject.Find("Canvas/xfs/ConnectGun").GetComponent<Button>();
|
||||
connectfa = GameObject.Find("Canvas/xfs/ConnectFa").GetComponent<Button>();
|
||||
openfa = GameObject.Find("Canvas/xfs/OpenFa").GetComponent<Button>();
|
||||
//Timermusk = GameObject.Find("Canvas/xfs/Timerbg/Timermusk").GetComponent<Image>();
|
||||
//TimerText = GameObject.Find("Canvas/xfs/Timerbg/Timermusk/Timernumer").GetComponent<Text>();
|
||||
Characterain = this.GetComponent<CharacterAin>();
|
||||
//animator = this.GetComponent<Animator>();
|
||||
// stateInfo = animator.GetCurrentAnimatorStateInfo(0);
|
||||
@ -77,7 +75,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
Debug.Log("连接水枪");
|
||||
CoGunHide(0);
|
||||
XfsStep++;
|
||||
StartCoroutine(AnimTime(6f));
|
||||
StartCoroutine(AnimTimeSuccefful(6f));
|
||||
Characterain.SetSkillAin(CharacterSkill.OperateSuccess);
|
||||
}
|
||||
else
|
||||
@ -87,7 +85,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
Debug.Log("操作失败,重新开始");
|
||||
XfsStep = 0;
|
||||
CoGunHide(0);
|
||||
StartCoroutine(AnimTime(2f));
|
||||
StartCoroutine(AnimTimeFail(2f));
|
||||
Characterain.SetSkillAin(CharacterSkill.OperateFail);
|
||||
|
||||
}
|
||||
@ -102,7 +100,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
Debug.Log("连接水阀");
|
||||
CoGunHide(1);
|
||||
XfsStep++;
|
||||
StartCoroutine(AnimTime(6f));
|
||||
StartCoroutine(AnimTimeSuccefful(6f));
|
||||
connectfa.gameObject.SetActive(false);
|
||||
Characterain.SetSkillAin(CharacterSkill.OperateSuccess);
|
||||
}
|
||||
@ -111,10 +109,8 @@ public class CharacterInturn : MonoBehaviour
|
||||
//执行操作失败动画
|
||||
XfsStep = 0;
|
||||
CoGunHide(0);
|
||||
StartCoroutine(AnimTime(2f));
|
||||
StartCoroutine(AnimTimeFail(2f));
|
||||
Characterain.SetSkillAin(CharacterSkill.OperateFail);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -127,7 +123,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
Debug.Log("打开水阀");
|
||||
CoGunHide(1);
|
||||
XfsStep++;
|
||||
StartCoroutine(AnimTime(6f));
|
||||
StartCoroutine(AnimTimeSuccefful(6f));
|
||||
Characterain.SetSkillAin(CharacterSkill.OperateSuccess);
|
||||
|
||||
}
|
||||
@ -136,7 +132,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
//执行操作失败动画
|
||||
XfsStep = 0;
|
||||
CoGunHide(0);
|
||||
StartCoroutine(AnimTime(2f));
|
||||
StartCoroutine(AnimTimeFail(2f));
|
||||
Characterain.SetSkillAin(CharacterSkill.OperateFail);
|
||||
|
||||
}
|
||||
@ -145,19 +141,34 @@ public class CharacterInturn : MonoBehaviour
|
||||
|
||||
|
||||
|
||||
IEnumerator AnimTime(float timer)
|
||||
IEnumerator AnimTimeSuccefful(float timer)//操作成功执行的协程
|
||||
{
|
||||
TimerMgr.Instance.StartCooldown(timer, HandleCooldownFinished); // 传入冷却时间和结束事件
|
||||
yield return null;
|
||||
|
||||
}
|
||||
|
||||
IEnumerator AnimTimeFail(float timer)//操作失败执行的协程
|
||||
{
|
||||
TimerMgr.Instance.StartCooldown(timer, HandleCooldownFinishedFailed);
|
||||
yield return null;
|
||||
}
|
||||
|
||||
void HandleCooldownFinished()//这里添加一个事件用来处理计时器冷却技术后的逻辑
|
||||
void HandleCooldownFinished()//消防栓操作成功,这里添加一个事件用来处理计时器冷却技术后的逻辑
|
||||
{
|
||||
Characterain.SetSkillAin(CharacterSkill.NoSkill);
|
||||
CoApper();
|
||||
}
|
||||
|
||||
IEnumerator Rescuereturn(float timer)//携程实现npc被救援成功后进行撤离
|
||||
void HandleCooldownFinishedFailed()//消防栓操作失败结束后的事件处理,添加一个全局的气泡弹窗
|
||||
{
|
||||
PromptMgr.Instance.PromptBubble("操作失败");
|
||||
Characterain.SetSkillAin(CharacterSkill.NoSkill);
|
||||
CoApper();
|
||||
|
||||
}
|
||||
|
||||
IEnumerator Rescuereturn(float timer)//协程实现npc被救援成功后进行撤离
|
||||
{
|
||||
recubtn.gameObject.SetActive(false);
|
||||
TimerMgr.Instance.StartCooldown(timer,HandleRescue);
|
||||
@ -165,7 +176,7 @@ public class CharacterInturn : MonoBehaviour
|
||||
|
||||
|
||||
}
|
||||
void HandleRescue()
|
||||
void HandleRescue()//救援成功后对人物动作进行的处理,以及npc前往指定地点的处理
|
||||
{
|
||||
Characterain.SetSkillAin(CharacterSkill.NoSkill);
|
||||
cha.GetComponent<RecuseNpc>().Setnpcstate();
|
||||
|
8
xiaofang/Assets/Script/Manager.meta
Normal file
8
xiaofang/Assets/Script/Manager.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 268b0ab8ef456d54eaa0c070b1061565
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
56
xiaofang/Assets/Script/Manager/PromptMgr.cs
Normal file
56
xiaofang/Assets/Script/Manager/PromptMgr.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
public class PromptMgr : MonoBehaviour
|
||||
{
|
||||
public static PromptMgr Instance;
|
||||
private GameObject PromptPrefab;
|
||||
private Transform promptpos;
|
||||
private float movedistance = 300f;//移动的距离
|
||||
private float moveDuration = 1f;//移动所需的时间
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
Instance = this;
|
||||
PromptPrefab = (GameObject)Resources.Load("UIPrefab/PromptBg");
|
||||
promptpos = GameObject.Find("Canvas/Prompt").GetComponent<Transform>();
|
||||
}
|
||||
|
||||
public void PromptBubble(string message)
|
||||
{
|
||||
GameObject proobj = Instantiate(PromptPrefab, promptpos);
|
||||
StartCoroutine(MoveUpandDestory(proobj));
|
||||
Text protext = proobj.transform.Find("PromptText").GetComponent<Text>(); ;
|
||||
protext.text = message;
|
||||
|
||||
}
|
||||
|
||||
IEnumerator MoveUpandDestory(GameObject obj)
|
||||
{
|
||||
RectTransform uielement = obj.GetComponent<RectTransform>();
|
||||
Vector3 startPosition = uielement.anchoredPosition;
|
||||
Vector3 endPosition = startPosition + new Vector3(0, movedistance, 0);
|
||||
|
||||
float elapsedTime = 0f;
|
||||
|
||||
while (elapsedTime < moveDuration)
|
||||
{
|
||||
uielement.anchoredPosition = Vector3.Lerp(startPosition, endPosition, (elapsedTime / moveDuration));
|
||||
elapsedTime += Time.deltaTime;
|
||||
yield return null; // 等待下一帧
|
||||
}
|
||||
|
||||
uielement.anchoredPosition = endPosition; // 确保最终位置准确
|
||||
|
||||
// 等待一段时间后销毁
|
||||
yield return new WaitForSeconds(1f); // 可调整的等待时间
|
||||
Destroy(uielement.gameObject); // 销毁UI元素
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
|
||||
}
|
11
xiaofang/Assets/Script/Manager/PromptMgr.cs.meta
Normal file
11
xiaofang/Assets/Script/Manager/PromptMgr.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5fd175c3febbaa5479b3fb2871b6e49d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -31,7 +31,7 @@ public class RecuseNpc : MonoBehaviour
|
||||
|
||||
private void OnTriggerEnter(Collider other)//通过触发器得到对应的救援组人员标签,是否显现出UI
|
||||
{
|
||||
if(other.name == "Man")
|
||||
if(other.tag == "Player")
|
||||
recusebtn.gameObject.SetActive(true);
|
||||
if (statebool) return;
|
||||
other.GetComponent<CharacterInturn>().cha = this.gameObject ;
|
||||
|
Loading…
Reference in New Issue
Block a user