异常记录和步骤
This commit is contained in:
parent
43f48c0d7d
commit
a5b4471567
|
|
@ -352,6 +352,12 @@
|
|||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>E:\Unity Projects\GitLab\2024\ShanxiKnowledgeBase\SXElectricityInformationAcquisition\Assets\Plugins\Newtonsoft\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ookii.Dialogs">
|
||||
<HintPath>E:\Unity Projects\GitLab\2024\ShanxiKnowledgeBase\SXElectricityInformationAcquisition\Assets\StandaloneFileBrowser\Plugins\Ookii.Dialogs.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<HintPath>E:\Unity Projects\GitLab\2024\ShanxiKnowledgeBase\SXElectricityInformationAcquisition\Assets\StandaloneFileBrowser\Plugins\System.Windows.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>E:\Unity Projects\GitLab\2024\ShanxiKnowledgeBase\SXElectricityInformationAcquisition\Library\PackageCache\com.unity.ext.nunit@1.0.6\net35\unity-custom\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
<Analyzer Include="E:\Program Files\Unity 2022.3.22f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\LadderTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\ProcessMode\ProcessMode.cs" />
|
||||
<Compile Include="Assets\Scripts\ToolsPack\ToolsPackWindowManager.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\FOVKick.cs" />
|
||||
<Compile Include="Assets\HighlightPlus\Scripts\HighlightEffectOccluderManager.cs" />
|
||||
|
|
@ -53,16 +53,20 @@
|
|||
<Compile Include="Assets\Standard Assets 1\Vehicles\Aircraft\Scripts\LandingGear.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\DragRigidbody.cs" />
|
||||
<Compile Include="Assets\HighlightPlus\Scripts\HighlightProfile.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\Sample\CanvasSampleOpenFileTextMultiple.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\Joystick.cs" />
|
||||
<Compile Include="Assets\Scripts\ToolsPack\ToolsPackMenuBtOnClick.cs" />
|
||||
<Compile Include="Assets\Framework\GameLauncher.cs" />
|
||||
<Compile Include="Assets\Scripts\ToolsPack\ToolsPackManager.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\AxisTouchButton.cs" />
|
||||
<Compile Include="Assets\Model\Fantastic City Generator\Traffic_Light\Scripts\TFShiftHand2.cs" />
|
||||
<Compile Include="Assets\Scripts\test1.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\WaypointCircuit.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Characters\ThirdPersonCharacter\Scripts\ThirdPersonUserControl.cs" />
|
||||
<Compile Include="Assets\taoruiqi\Pliers.cs" />
|
||||
<Compile Include="Assets\taoruiqi\WorkPermit.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\PlatformSpecific\MobileInput.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\StandaloneFileBrowserWindows.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\SimpleMouseRotator.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Car\Scripts\CarAudio.cs" />
|
||||
<Compile Include="Assets\Model\Fantastic City Generator\Traffic_Light\Scripts\TrafficLights2.cs" />
|
||||
|
|
@ -86,9 +90,10 @@
|
|||
<Compile Include="Assets\Standard Assets 1\Utility\AutoMoveAndRotate.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\LerpControlledBob.cs" />
|
||||
<Compile Include="Assets\Scripts\ToolsPackSceneManager.cs" />
|
||||
<Compile Include="Assets\Scripts\FaultRecords\FaultRecordManager.cs" />
|
||||
<Compile Include="Assets\Scripts\ProcessMode\test.cs" />
|
||||
<Compile Include="Assets\Scripts\CharacterEquipWindow\CharacterEquipWindowManager.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Characters\ThirdPersonCharacter\Scripts\AICharacterControl.cs" />
|
||||
<Compile Include="Assets\Pliers.cs" />
|
||||
<Compile Include="Assets\taoruiqi\Script\Field observation.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\PlatformSpecificContent.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Aircraft\Scripts\AeroplaneController.cs" />
|
||||
|
|
@ -99,26 +104,33 @@
|
|||
<Compile Include="Assets\HighlightPlus\Scripts\HighlightEffectActions.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Camera Scripts\MouseLook.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\SmoothFollow.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\StandaloneFileBrowser.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\VirtualInput.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\Sample\CanvasSampleSaveFileImage.cs" />
|
||||
<Compile Include="Assets\Ladder.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\ForcedReset.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\DynamicShadowSettings.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Aircraft\Scripts\JetParticleEffect.cs" />
|
||||
<Compile Include="Assets\Model\Fantastic City Generator\Traffic_Light\Scripts\TrafficLight.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\IStandaloneFileBrowser.cs" />
|
||||
<Compile Include="Assets\HighlightPlus\Scripts\HighlightManager.cs" />
|
||||
<Compile Include="Assets\3rdParty\ModularFirstPersonController\FirstPersonController\FirstPersonController.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\StandaloneFileBrowserLinux.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Characters\RollerBall\Scripts\Ball.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Car\Scripts\WheelEffects.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Aircraft\Scripts\AeroplaneAudio.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\Sample\CanvasSampleSaveFileText.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\FPSCounter.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Characters\FirstPersonCharacter\Scripts\MouseLook.cs" />
|
||||
<Compile Include="Assets\Scripts\ScriptDescriptionAttribute.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\CameraRefocus.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\ButtonHandler.cs" />
|
||||
<Compile Include="Assets\Model\Fantastic City Generator\Water\WaterSample.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\Sample\CanvasSampleOpenFileText.cs" />
|
||||
<Compile Include="Assets\HighlightPlus\Scripts\HighlightEffect.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Car\Scripts\CarController.cs" />
|
||||
<Compile Include="Assets\HighlightPlus\Scripts\InputProxy.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\Sample\BasicSample.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Car\Scripts\BrakeLight.cs" />
|
||||
<Compile Include="Assets\Scripts\CharacterEquipWindow\CharacterMirrorManager.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Characters\ThirdPersonCharacter\Scripts\ThirdPersonCharacter.cs" />
|
||||
|
|
@ -126,24 +138,34 @@
|
|||
<Compile Include="Assets\Scripts\ToolsPack\ToolsPackWindowItemBtComponent.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\TouchPad.cs" />
|
||||
<Compile Include="Assets\Model\Fantastic City Generator\DayNight\ShiftAtRuntime.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\Sample\CanvasSampleOpenFileImage.cs" />
|
||||
<Compile Include="Assets\taoruiqi\Script\NPC Dialogue.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\StandaloneFileBrowserMac.cs" />
|
||||
<Compile Include="Assets\Scripts\CharacterEquipWindow\CharacterEquipBtOnClick.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\AlphaButtonClickMask.cs" />
|
||||
<Compile Include="Assets\taoruiqi\LadderTrigger.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\AutoMobileShaderSwitch.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\TiltInput.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\TimedObjectDestructor.cs" />
|
||||
<Compile Include="Assets\Scripts\ProcessMode\AnimationProcess.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\TimedObjectActivator.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\ParticleSystemDestroyer.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Car\Scripts\SkidTrail.cs" />
|
||||
<Compile Include="Assets\Scripts\ProcessMode\AnimationStep.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\CrossPlatformInput\Scripts\MobileControlRig.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\WaypointProgressTracker.cs" />
|
||||
<Compile Include="Assets\Scripts\FaultRecords\FaultRecordUI.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Aircraft\Scripts\AeroplanePropellerAnimator.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Car\Scripts\CarUserControl.cs" />
|
||||
<Compile Include="Assets\Model\Fantastic City Generator\Traffic System\DataSpawn.cs" />
|
||||
<Compile Include="Assets\HighlightPlus\Scripts\HighlightSeeThroughOccluder.cs" />
|
||||
<Compile Include="Assets\Scripts\ProcessMode\ProcessUIManager.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Aircraft\Scripts\AeroplaneAiControl.cs" />
|
||||
<Compile Include="Assets\Scripts\FaultRecords\FaultRecord.cs" />
|
||||
<Compile Include="Assets\Scripts\ProcessMode\AnimationProcessManager.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Characters\FirstPersonCharacter\Scripts\HeadBob.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Characters\RollerBall\Scripts\BallUserControl.cs" />
|
||||
<Compile Include="Assets\StandaloneFileBrowser\StandaloneFileBrowserEditor.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Vehicles\Car\Scripts\CarAIControl.cs" />
|
||||
<Compile Include="Assets\Standard Assets 1\Utility\FollowTarget.cs" />
|
||||
<Compile Include="Assets\taoruiqi\Script\RotationOfDoor.cs" />
|
||||
|
|
@ -153,6 +175,7 @@
|
|||
<Compile Include="Assets\taoruiqi\Script\ThreeTransformerPhotovoltaicView.cs" />
|
||||
<None Include="Assets\TextMesh Pro\Shaders\TMPro.cginc" />
|
||||
<None Include="Assets\TextMesh Pro\Shaders\TMP_SDF-Mobile Overlay.shader" />
|
||||
<None Include="Assets\StreamingAssets\FaultRecords\FaultRecords.json" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightOverlay.shader" />
|
||||
<None Include="Assets\TextMesh Pro\Shaders\TMP_Bitmap.shader" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightOccluder.shader" />
|
||||
|
|
@ -173,12 +196,14 @@
|
|||
<None Include="Assets\TextMesh Pro\Shaders\TMP_SDF-Surface-Mobile.shader" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightInnerGlow.shader" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightSeeThroughInner.shader" />
|
||||
<None Include="Assets\StreamingAssets\FaultRecords\FaultRecords - 副本.json" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightMask.shader" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightUIMask.shader" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightSeeThroughBorder.shader" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightSolidColor.shader" />
|
||||
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightComposeGlow.shader" />
|
||||
<None Include="Assets\TextMesh Pro\Shaders\TMP_SDF-Surface.shader" />
|
||||
<None Include="Assets\Shader\JiaoDai.shader" />
|
||||
<None Include="Assets\TextMesh Pro\Sprites\EmojiOne Attribution.txt" />
|
||||
<None Include="Assets\TextMesh Pro\Shaders\TMP_Bitmap-Custom-Atlas.shader" />
|
||||
<None Include="Assets\TextMesh Pro\Shaders\TMP_SDF.shader" />
|
||||
|
|
@ -468,6 +493,12 @@
|
|||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>E:\Unity Projects\GitLab\2024\ShanxiKnowledgeBase\SXElectricityInformationAcquisition\Assets\Plugins\Newtonsoft\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ookii.Dialogs">
|
||||
<HintPath>E:\Unity Projects\GitLab\2024\ShanxiKnowledgeBase\SXElectricityInformationAcquisition\Assets\StandaloneFileBrowser\Plugins\Ookii.Dialogs.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<HintPath>E:\Unity Projects\GitLab\2024\ShanxiKnowledgeBase\SXElectricityInformationAcquisition\Assets\StandaloneFileBrowser\Plugins\System.Windows.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib">
|
||||
<HintPath>E:\Program Files\Unity 2022.3.22f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 36a399708d9c5f0458fbae37107db13c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,413 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2678489646271079916
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7000754436863406887}
|
||||
- component: {fileID: 7091765149323847856}
|
||||
- component: {fileID: 531998678588977338}
|
||||
m_Layer: 5
|
||||
m_Name: FaultRecordItem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7000754436863406887
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2678489646271079916}
|
||||
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: 4601700199380906642}
|
||||
- {fileID: 3910321768582686195}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1184.1411, y: 55.08}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7091765149323847856
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2678489646271079916}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &531998678588977338
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2678489646271079916}
|
||||
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: 0}
|
||||
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!1 &3723198386877972089
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3928838060789135501}
|
||||
- component: {fileID: 7616782447973965054}
|
||||
- component: {fileID: 7503266894788223589}
|
||||
m_Layer: 5
|
||||
m_Name: Text (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3928838060789135501
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3723198386877972089}
|
||||
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: 4601700199380906642}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7616782447973965054
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3723198386877972089}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7503266894788223589
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3723198386877972089}
|
||||
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: "\u5220\u9664"
|
||||
--- !u!1 &4853940457824160336
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3910321768582686195}
|
||||
- component: {fileID: 7199736040225524975}
|
||||
- component: {fileID: 8570125199865112293}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3910321768582686195
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4853940457824160336}
|
||||
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: 7000754436863406887}
|
||||
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: -57.981567, y: 0}
|
||||
m_SizeDelta: {x: 1034.4481, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7199736040225524975
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4853940457824160336}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8570125199865112293
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4853940457824160336}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text:
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 703c5bf45144ac448a6d18fc3c044972, type: 2}
|
||||
m_sharedMaterial: {fileID: -8603090892031157933, guid: 703c5bf45144ac448a6d18fc3c044972, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4278190080
|
||||
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 19.27
|
||||
m_fontSizeBase: 19.27
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 1
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &8647535275257787612
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4601700199380906642}
|
||||
- component: {fileID: 4298353103016399459}
|
||||
- component: {fileID: 8923153144836911240}
|
||||
- component: {fileID: 3443267670041591971}
|
||||
m_Layer: 5
|
||||
m_Name: Button (Legacy)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4601700199380906642
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8647535275257787612}
|
||||
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: 3928838060789135501}
|
||||
m_Father: {fileID: 7000754436863406887}
|
||||
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: 528, y: 0}
|
||||
m_SizeDelta: {x: 85.9478, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4298353103016399459
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8647535275257787612}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8923153144836911240
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8647535275257787612}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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!114 &3443267670041591971
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8647535275257787612}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 8923153144836911240}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b1597783248780c4f8f29a9a40993e16
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 62e20368ea041df4bb96b1e042cacd31
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -9,6 +9,7 @@ using UnityEngine.UI;
|
|||
/// <summary>
|
||||
/// 镜子管理器
|
||||
/// </summary>
|
||||
|
||||
public class CharacterMirrorManager : MonoBehaviour
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 43238418918d4070bb7258541aca2d21
|
||||
timeCreated: 1717742833
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
namespace DefaultNamespace.FaultRecords
|
||||
{
|
||||
[System.Serializable] // 使类可以被序列化为JSON格式
|
||||
public class FaultRecord
|
||||
{
|
||||
public string content; // 故障记录的内容
|
||||
public System.DateTime dateTime; // 记录的时间
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1e41326a3ab04e3d94f17c1aa07719b6
|
||||
timeCreated: 1717742840
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using DefaultNamespace.FaultRecords;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace.FaultRecords
|
||||
{
|
||||
public class FaultRecordManager
|
||||
{
|
||||
public List<FaultRecord> records = new List<FaultRecord>(); // 故障记录列表
|
||||
public string filePath = Application.streamingAssetsPath+"/FaultRecords/FaultRecords.json"; // 保存记录的文件路径
|
||||
|
||||
// 新增故障记录
|
||||
public void AddRecord(string content)
|
||||
{
|
||||
FaultRecord newRecord = new FaultRecord
|
||||
{
|
||||
content = content,
|
||||
dateTime = System.DateTime.Now
|
||||
};
|
||||
records.Add(newRecord);
|
||||
SaveRecords(); // 保存记录到文件
|
||||
}
|
||||
|
||||
// 删除指定索引的记录
|
||||
public void DeleteRecord(int index)
|
||||
{
|
||||
if (index >= 0 && index < records.Count)
|
||||
{
|
||||
records.RemoveAt(index);
|
||||
SaveRecords(); // 保存变更后的记录到文件
|
||||
}
|
||||
}
|
||||
|
||||
// 保存记录到文件
|
||||
public void SaveRecords()
|
||||
{
|
||||
string json = JsonUtility.ToJson(new FaultRecordList(records), true); // 将记录列表转换为JSON格式
|
||||
File.WriteAllText(filePath, json); // 将JSON写入文件
|
||||
}
|
||||
|
||||
// 从文件加载记录
|
||||
public void LoadRecords()
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
string json = File.ReadAllText(filePath); // 读取文件内容
|
||||
if(json=="")
|
||||
return;
|
||||
FaultRecordList loadedRecords = JsonUtility.FromJson<FaultRecordList>(json); // 将JSON转换为记录列表
|
||||
records = loadedRecords.records;
|
||||
}
|
||||
}
|
||||
|
||||
// 导出记录到指定路径
|
||||
public void ExportRecords(string exportPath)
|
||||
{
|
||||
string json = JsonUtility.ToJson(new FaultRecordList(records), true); // 将记录列表转换为JSON格式
|
||||
File.WriteAllText(exportPath, json); // 将JSON写入指定文件
|
||||
}
|
||||
|
||||
// 从指定路径导入记录
|
||||
public void ImportRecords(string importPath)
|
||||
{
|
||||
if (File.Exists(importPath))
|
||||
{
|
||||
string json = File.ReadAllText(importPath); // 读取文件内容
|
||||
FaultRecordList importedRecords = JsonUtility.FromJson<FaultRecordList>(json); // 将JSON转换为记录列表
|
||||
records.AddRange(importedRecords.records); // 将导入的记录添加到现有记录中
|
||||
SaveRecords(); // 保存变更后的记录到文件
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 包装类用于序列化记录列表
|
||||
[System.Serializable]
|
||||
public class FaultRecordList
|
||||
{
|
||||
public List<FaultRecord> records;
|
||||
|
||||
public FaultRecordList(List<FaultRecord> records)
|
||||
{
|
||||
this.records = records;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7dcab46456b14b8c9cba834ec346f25c
|
||||
timeCreated: 1717742851
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
using System.Linq;
|
||||
using SFB;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace DefaultNamespace.FaultRecords
|
||||
{
|
||||
public class FaultRecordUI : MonoBehaviour
|
||||
{
|
||||
public FaultRecordManager recordManager; // 故障记录管理器
|
||||
public TMP_InputField inputField; // 输入框,用于输入故障记录内容
|
||||
public Transform recordListContent; // 显示故障记录的列表内容容器
|
||||
public GameObject recordItemPrefab; // 记录项预制件
|
||||
public Button addButton; // 新增记录按钮
|
||||
public Button exportButton; // 导出记录按钮
|
||||
public Button importButton; // 导入记录按钮
|
||||
public string exportFilePath = Application.streamingAssetsPath + "/FaultRecords/FaultRecords.json"; // 导出文件路径
|
||||
public string importFilePath = Application.streamingAssetsPath + "/FaultRecords/FaultRecords.json"; // 导入文件路径
|
||||
|
||||
void Start()
|
||||
{
|
||||
recordManager = new FaultRecordManager();
|
||||
|
||||
addButton.onClick.AddListener(OnAddButtonClicked); // 绑定新增按钮点击事件
|
||||
exportButton.onClick.AddListener(OnExportButtonClicked); // 绑定导出按钮点击事件
|
||||
importButton.onClick.AddListener(OnImportButtonClicked); // 绑定导入按钮点击事件
|
||||
|
||||
recordManager.LoadRecords(); // 加载已有记录
|
||||
UpdateRecordList(); // 更新UI列表显示
|
||||
}
|
||||
|
||||
// 新增记录按钮点击事件
|
||||
void OnAddButtonClicked()
|
||||
{
|
||||
string content = inputField.text;
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
{
|
||||
recordManager.AddRecord(content);
|
||||
UpdateRecordList();
|
||||
inputField.text = string.Empty; // 清空输入框
|
||||
}
|
||||
}
|
||||
|
||||
// 导出记录按钮点击事件
|
||||
void OnExportButtonClicked()
|
||||
{
|
||||
string path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "", "json");
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
recordManager.ExportRecords(path);
|
||||
}
|
||||
}
|
||||
|
||||
// 导入记录按钮点击事件
|
||||
void OnImportButtonClicked()
|
||||
{
|
||||
string[] paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", "json", false);
|
||||
if (paths.Length > 0)
|
||||
{
|
||||
recordManager.ImportRecords(paths[0]);
|
||||
UpdateRecordList();
|
||||
}
|
||||
}
|
||||
|
||||
// 更新记录列表显示
|
||||
void UpdateRecordList()
|
||||
{
|
||||
// 清空现有的列表项
|
||||
foreach (Transform child in recordListContent)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
// 创建新的列表项
|
||||
foreach (var record in recordManager.records.Select((value, index) => new { value, index }))
|
||||
{
|
||||
GameObject item = Instantiate(recordItemPrefab, recordListContent);
|
||||
item.GetComponentInChildren<TMP_Text>().text = record.value.content ;
|
||||
int index = record.index;
|
||||
item.GetComponentInChildren<Button>().onClick.AddListener(() => OnDeleteButtonClicked(index));
|
||||
}
|
||||
}
|
||||
|
||||
// 删除记录按钮点击事件
|
||||
void OnDeleteButtonClicked(int index)
|
||||
{
|
||||
recordManager.DeleteRecord(index);
|
||||
UpdateRecordList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 02549c8175694d7eb618e6f9ef41e758
|
||||
timeCreated: 1717742907
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: acf0b052402b4bbb83cd36dda7bdf73a
|
||||
timeCreated: 1717728816
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace DefaultNamespace.ProcessMode
|
||||
{
|
||||
public class AnimationProcess
|
||||
{
|
||||
public string Type { get; set; } // 流程类型(例如:教学、培训、练习)
|
||||
public List<AnimationStep> Steps { get; private set; } // 流程中的步骤列表
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="type">流程类型</param>
|
||||
public AnimationProcess(string type)
|
||||
{
|
||||
Type = type;
|
||||
Steps = new List<AnimationStep>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加步骤到流程中
|
||||
/// </summary>
|
||||
/// <param name="step">要添加的步骤</param>
|
||||
public void AddStep(AnimationStep step)
|
||||
{
|
||||
Steps.Add(step);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算流程的总评分
|
||||
/// </summary>
|
||||
/// <returns>总评分</returns>
|
||||
public float CalculateTotalScore()
|
||||
{
|
||||
float totalScore = 0;
|
||||
foreach (AnimationStep step in Steps)
|
||||
{
|
||||
totalScore += step.Score;
|
||||
}
|
||||
return totalScore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3b526e206bc640a787364cf5b2eb8706
|
||||
timeCreated: 1717739600
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
using System.Collections.Generic;
|
||||
using MotionFramework;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace DefaultNamespace.ProcessMode
|
||||
{
|
||||
[ScriptDescription("流程模式管理器")]
|
||||
public class AnimationProcessManager : MonoBehaviour
|
||||
{
|
||||
private Dictionary<string, AnimationProcess> processes; // 存储不同类型流程的字典
|
||||
public ProcessMode currentMode; // 当前模式
|
||||
private int currentStepIndex; // 当前步骤索引
|
||||
private ProcessUIManager uiManager; // 引用UIManager实例
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="uiManager">UIManager实例</param>
|
||||
public AnimationProcessManager(ProcessUIManager uiManager)
|
||||
{
|
||||
this.uiManager = uiManager;
|
||||
processes = new Dictionary<string, AnimationProcess>();
|
||||
InitializeProcesses(); // 初始化流程
|
||||
currentStepIndex = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化所有流程
|
||||
/// </summary>
|
||||
private void InitializeProcesses()
|
||||
{
|
||||
AddProcess("Teaching"); // 添加教学流程
|
||||
AddProcess("Training"); // 添加培训流程
|
||||
AddProcess("Practice"); // 添加练习流程
|
||||
AddProcess("Assessment"); // 添加考核流程
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加一个新的流程
|
||||
/// </summary>
|
||||
/// <param name="type">流程类型</param>
|
||||
public void AddProcess(string type)
|
||||
{
|
||||
if (!processes.ContainsKey(type))
|
||||
{
|
||||
processes[type] = new AnimationProcess(type);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向指定类型的流程中添加步骤
|
||||
/// </summary>
|
||||
/// <param name="type">流程类型</param>
|
||||
/// <param name="step">要添加的步骤</param>
|
||||
public void AddStepToProcess(string type, AnimationStep step)
|
||||
{
|
||||
if (processes.ContainsKey(type))
|
||||
{
|
||||
processes[type].AddStep(step);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定类型流程的总评分
|
||||
/// </summary>
|
||||
/// <param name="type">流程类型</param>
|
||||
/// <returns>总评分</returns>
|
||||
public float GetTotalScoreForProcess(string type)
|
||||
{
|
||||
if (processes.ContainsKey(type))
|
||||
{
|
||||
return processes[type].CalculateTotalScore();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理用户点击事件
|
||||
/// </summary>
|
||||
/// <param name="clickedObject">被点击的对象</param>
|
||||
public void HandleClick(GameObject clickedObject)
|
||||
{
|
||||
string type = currentMode.ToString();
|
||||
|
||||
if (processes.ContainsKey(type))
|
||||
{
|
||||
AnimationProcess process = processes[type];
|
||||
|
||||
if (currentStepIndex < process.Steps.Count)
|
||||
{
|
||||
AnimationStep step = process.Steps[currentStepIndex];
|
||||
|
||||
if (step.CorrectObject == clickedObject)
|
||||
{
|
||||
step.PlayAnimation();
|
||||
|
||||
switch (currentMode)
|
||||
{
|
||||
case ProcessMode.Teaching:
|
||||
uiManager.HighlightNextStep(step); // 高亮下一个步骤
|
||||
break;
|
||||
case ProcessMode.Training:
|
||||
uiManager.ShowTrainingStep(step); // 显示培训步骤
|
||||
break;
|
||||
case ProcessMode.Practice:
|
||||
uiManager.ShowPracticeStep(step); // 显示练习步骤
|
||||
break;
|
||||
case ProcessMode.Assessment:
|
||||
// 无提示
|
||||
break;
|
||||
}
|
||||
|
||||
currentStepIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Incorrect object clicked.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c514b173d1fd44c1be8a99bba5224f0c
|
||||
timeCreated: 1717728908
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace.ProcessMode
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示一个流程步骤的类
|
||||
/// </summary>
|
||||
public class AnimationStep
|
||||
{
|
||||
public string Description { get; set; } // 步骤描述
|
||||
public float Score { get; set; } // 步骤评分
|
||||
public Action Animation { get; private set; } // DOTween动画
|
||||
public GameObject CorrectObject { get; set; } // 正确的点击对象
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="description">步骤描述</param>
|
||||
/// <param name="score">步骤评分</param>
|
||||
/// <param name="animation">要播放的动画</param>
|
||||
/// <param name="correctObject">正确的点击对象</param>
|
||||
public AnimationStep(string description, float score, Action animation, GameObject correctObject)
|
||||
{
|
||||
Description = description;
|
||||
Score = score;
|
||||
Animation = animation;
|
||||
CorrectObject = correctObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 播放动画
|
||||
/// </summary>
|
||||
public void PlayAnimation()
|
||||
{
|
||||
Animation?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8be94b99117d4f8cb155e4040dad827a
|
||||
timeCreated: 1717730542
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
namespace DefaultNamespace.ProcessMode
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程模式枚举
|
||||
/// </summary>
|
||||
public enum ProcessMode
|
||||
{
|
||||
Teaching, // 教学模式
|
||||
Training, // 培训模式
|
||||
Practice, // 练习模式
|
||||
Assessment // 考核模式
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 091eda4e3d224c799298ffd8a573db54
|
||||
timeCreated: 1717739548
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace DefaultNamespace.ProcessMode
|
||||
{
|
||||
public class ProcessUIManager
|
||||
{
|
||||
public Text trainingTextBox; // 培训模式的文本框
|
||||
public Text practiceTextBox; // 练习模式的文本框
|
||||
public GameObject highlightObject; // 高亮对象,用于教学模式
|
||||
|
||||
public AnimationProcessManager processManager; // 流程管理器实例
|
||||
|
||||
private void Start()
|
||||
{
|
||||
processManager = new AnimationProcessManager(this); // 传递UIManager实例
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
GameObject clickedObject = DetectClickedObject();
|
||||
if (clickedObject != null)
|
||||
{
|
||||
processManager.HandleClick(clickedObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检测点击的对象
|
||||
/// </summary>
|
||||
/// <returns>点击的对象</returns>
|
||||
private GameObject DetectClickedObject()
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
if (Physics.Raycast(ray, out hit))
|
||||
{
|
||||
return hit.collider.gameObject;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示培训步骤信息
|
||||
/// </summary>
|
||||
/// <param name="step">当前步骤</param>
|
||||
public void ShowTrainingStep(AnimationStep step)
|
||||
{
|
||||
if (trainingTextBox != null)
|
||||
{
|
||||
trainingTextBox.text = step.Description;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示练习步骤信息
|
||||
/// </summary>
|
||||
/// <param name="step">当前步骤</param>
|
||||
public void ShowPracticeStep(AnimationStep step)
|
||||
{
|
||||
if (practiceTextBox != null)
|
||||
{
|
||||
practiceTextBox.text = step.Description;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 高亮显示下一个需要点击的地方(教学模式)
|
||||
/// </summary>
|
||||
/// <param name="step">当前步骤</param>
|
||||
public void HighlightNextStep(AnimationStep step)
|
||||
{
|
||||
if (highlightObject != null)
|
||||
{
|
||||
highlightObject.SetActive(true);
|
||||
// 假设你有一个方法来定位高亮对象
|
||||
// highlightObject.transform.position = ...;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7ebad6a729d44621873e93e1cd6f2b60
|
||||
timeCreated: 1717742043
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace.ProcessMode
|
||||
{
|
||||
public class test : MonoBehaviour
|
||||
{
|
||||
private AnimationProcessManager processManager;
|
||||
|
||||
public GameObject device1; // 假设这是场景中的一个设备
|
||||
public GameObject device2; // 假设这是场景中的另一个设备
|
||||
|
||||
private void Start()
|
||||
{
|
||||
processManager = GetComponent<AnimationProcessManager>();
|
||||
|
||||
// 设置模式
|
||||
processManager.currentMode = ProcessMode.Teaching;
|
||||
|
||||
// 创建步骤并避免未初始化的错误
|
||||
AnimationStep step1 = null;
|
||||
AnimationStep step2 = null;
|
||||
|
||||
|
||||
step1 = new AnimationStep("Step 1: Click device1", 10, () =>
|
||||
{
|
||||
device1.transform.DOMove(new Vector3(0, 1, 0), 1).OnComplete(() =>
|
||||
{
|
||||
processManager.AddStepToProcess("Teaching", step1);
|
||||
});
|
||||
}, device1);
|
||||
|
||||
step2 = new AnimationStep("Step 2: Click device2", 20, () =>
|
||||
{
|
||||
device2.transform.DOScale(new Vector3(2, 2, 2), 1).OnComplete(() =>
|
||||
{
|
||||
processManager.AddStepToProcess("Teaching", step2);
|
||||
});
|
||||
}, device2);
|
||||
|
||||
// 向流程中添加步骤
|
||||
processManager.AddStepToProcess("Teaching", step1);
|
||||
processManager.AddStepToProcess("Teaching", step2);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
// 假设您有方法来检测点击对象
|
||||
GameObject clickedObject = DetectClickedObject();
|
||||
if (clickedObject != null)
|
||||
{
|
||||
processManager.HandleClick(clickedObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private GameObject DetectClickedObject()
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
if (Physics.Raycast(ray, out hit))
|
||||
{
|
||||
return hit.collider.gameObject;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 51f73ee94f284a86b677a6bc74544094
|
||||
timeCreated: 1717740090
|
||||
|
|
@ -6,7 +6,7 @@ using UnityEngine.Serialization;
|
|||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
[ScriptDescription("工具间的选择类,除了工具间场景,其他场景应选择:其他")]
|
||||
[ScriptDescription("工具间的选择类,除了工具间场景,其他场景应选择:其他,为了背包里的UI不显示X")]
|
||||
public class ToolsPackSceneManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private ToolsPackScene toolsPackScene;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DefaultNamespace.ProcessMode;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
|
||||
public class test1 : MonoBehaviour
|
||||
{
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4fcc8a50684251544a748a6f8fda3c22
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 57e25b4a578dba94c9353f4633b20549
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace SFB {
|
||||
public interface IStandaloneFileBrowser {
|
||||
string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect);
|
||||
string[] OpenFolderPanel(string title, string directory, bool multiselect);
|
||||
string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions);
|
||||
|
||||
void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action<string[]> cb);
|
||||
void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action<string[]> cb);
|
||||
void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action<string> cb);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7609f7b6787a54496aa41a3053fcc76a
|
||||
timeCreated: 1483902788
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ddc4e7b83981f244ba9a26b88c18cb67
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 82666e520ab4d4cf08bebbb8059cd6f4
|
||||
folderAsset: yes
|
||||
timeCreated: 1538224809
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bd198408642944765b9305bd99404136
|
||||
folderAsset: yes
|
||||
timeCreated: 1538230728
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -0,0 +1,126 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b8c465928f1784a3fac8dc3766f7201c
|
||||
timeCreated: 1538230728
|
||||
licenseType: Free
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
- first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 0
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 0
|
||||
Exclude LinuxUniversal: 0
|
||||
Exclude OSXIntel: 1
|
||||
Exclude OSXIntel64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude SamsungTV: 1
|
||||
Exclude Tizen: 1
|
||||
Exclude WebGL: 1
|
||||
Exclude Win: 0
|
||||
Exclude Win64: 0
|
||||
Exclude iOS: 1
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
DefaultValueInitialized: true
|
||||
OS: Linux
|
||||
- first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Samsung TV: SamsungTV
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
STV_MODEL: STANDARD_15
|
||||
- first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -0,0 +1,145 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e60958662eed5413d86143a0a69b731e
|
||||
timeCreated: 1491979494
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 0
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXIntel: 1
|
||||
Exclude OSXIntel64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude WebGL: 1
|
||||
Exclude Win: 0
|
||||
Exclude Win64: 0
|
||||
Exclude iOS: 1
|
||||
data:
|
||||
first:
|
||||
'': Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 110fdfb459db4fc448a2ccd37e200fa4
|
||||
folderAsset: yes
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 996ea0b0fb9804844ba9595686ee3e7a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>18A391</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>StandaloneFileBrowser</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.gkngkc.sfb</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>StandaloneFileBrowser</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0 </string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>10A255</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>18A384</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.14</string>
|
||||
<key>DTXcode</key>
|
||||
<string>1000</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>10A255</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a5a66f5db020f344c9327188aec2c060
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -0,0 +1,90 @@
|
|||
var StandaloneFileBrowserWebGLPlugin = {
|
||||
// Open file.
|
||||
// gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage.
|
||||
// methodNamePtr: Callback method name on given GameObject.
|
||||
// filter: Filter files. Example filters:
|
||||
// Match all image files: "image/*"
|
||||
// Match all video files: "video/*"
|
||||
// Match all audio files: "audio/*"
|
||||
// Custom: ".plist, .xml, .yaml"
|
||||
// multiselect: Allows multiple file selection
|
||||
UploadFile: function(gameObjectNamePtr, methodNamePtr, filterPtr, multiselect) {
|
||||
gameObjectName = Pointer_stringify(gameObjectNamePtr);
|
||||
methodName = Pointer_stringify(methodNamePtr);
|
||||
filter = Pointer_stringify(filterPtr);
|
||||
|
||||
// Delete if element exist
|
||||
var fileInput = document.getElementById(gameObjectName)
|
||||
if (fileInput) {
|
||||
document.body.removeChild(fileInput);
|
||||
}
|
||||
|
||||
fileInput = document.createElement('input');
|
||||
fileInput.setAttribute('id', gameObjectName);
|
||||
fileInput.setAttribute('type', 'file');
|
||||
fileInput.setAttribute('style','display:none;');
|
||||
fileInput.setAttribute('style','visibility:hidden;');
|
||||
if (multiselect) {
|
||||
fileInput.setAttribute('multiple', '');
|
||||
}
|
||||
if (filter) {
|
||||
fileInput.setAttribute('accept', filter);
|
||||
}
|
||||
fileInput.onclick = function (event) {
|
||||
// File dialog opened
|
||||
this.value = null;
|
||||
};
|
||||
fileInput.onchange = function (event) {
|
||||
// multiselect works
|
||||
var urls = [];
|
||||
for (var i = 0; i < event.target.files.length; i++) {
|
||||
urls.push(URL.createObjectURL(event.target.files[i]));
|
||||
}
|
||||
// File selected
|
||||
SendMessage(gameObjectName, methodName, urls.join());
|
||||
|
||||
// Remove after file selected
|
||||
document.body.removeChild(fileInput);
|
||||
}
|
||||
document.body.appendChild(fileInput);
|
||||
|
||||
document.onmouseup = function() {
|
||||
fileInput.click();
|
||||
document.onmouseup = null;
|
||||
}
|
||||
},
|
||||
|
||||
// Save file
|
||||
// DownloadFile method does not open SaveFileDialog like standalone builds, its just allows user to download file
|
||||
// gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage.
|
||||
// methodNamePtr: Callback method name on given GameObject.
|
||||
// filenamePtr: Filename with extension
|
||||
// byteArray: byte[]
|
||||
// byteArraySize: byte[].Length
|
||||
DownloadFile: function(gameObjectNamePtr, methodNamePtr, filenamePtr, byteArray, byteArraySize) {
|
||||
gameObjectName = Pointer_stringify(gameObjectNamePtr);
|
||||
methodName = Pointer_stringify(methodNamePtr);
|
||||
filename = Pointer_stringify(filenamePtr);
|
||||
|
||||
var bytes = new Uint8Array(byteArraySize);
|
||||
for (var i = 0; i < byteArraySize; i++) {
|
||||
bytes[i] = HEAPU8[byteArray + i];
|
||||
}
|
||||
|
||||
var downloader = window.document.createElement('a');
|
||||
downloader.setAttribute('id', gameObjectName);
|
||||
downloader.href = window.URL.createObjectURL(new Blob([bytes], { type: 'application/octet-stream' }));
|
||||
downloader.download = filename;
|
||||
document.body.appendChild(downloader);
|
||||
|
||||
document.onmouseup = function() {
|
||||
downloader.click();
|
||||
document.body.removeChild(downloader);
|
||||
document.onmouseup = null;
|
||||
|
||||
SendMessage(gameObjectName, methodName);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
mergeInto(LibraryManager.library, StandaloneFileBrowserWebGLPlugin);
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 265aaf20a6d564e0fb00a9c4a7a9c300
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
- first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 1
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Facebook: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
WebGL: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -0,0 +1,145 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7d459a96865cc4aaab657012c6dc4833
|
||||
timeCreated: 1491979494
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 0
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXIntel: 1
|
||||
Exclude OSXIntel64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude WebGL: 1
|
||||
Exclude Win: 0
|
||||
Exclude Win64: 0
|
||||
Exclude iOS: 1
|
||||
data:
|
||||
first:
|
||||
'': Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 435c74f62ab57b448adeeb37cbc0f96b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using SFB;
|
||||
|
||||
public class BasicSample : MonoBehaviour {
|
||||
private string _path;
|
||||
|
||||
void OnGUI() {
|
||||
var guiScale = new Vector3(Screen.width / 800.0f, Screen.height / 600.0f, 1.0f);
|
||||
GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, guiScale);
|
||||
|
||||
GUILayout.Space(20);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Space(20);
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
// Open File Samples
|
||||
|
||||
if (GUILayout.Button("Open File")) {
|
||||
WriteResult(StandaloneFileBrowser.OpenFilePanel("Open File", "", "", false));
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Open File Async")) {
|
||||
StandaloneFileBrowser.OpenFilePanelAsync("Open File", "", "", false, (string[] paths) => { WriteResult(paths); });
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Open File Multiple")) {
|
||||
WriteResult(StandaloneFileBrowser.OpenFilePanel("Open File", "", "", true));
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Open File Extension")) {
|
||||
WriteResult(StandaloneFileBrowser.OpenFilePanel("Open File", "", "txt", true));
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Open File Directory")) {
|
||||
WriteResult(StandaloneFileBrowser.OpenFilePanel("Open File", Application.dataPath, "", true));
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Open File Filter")) {
|
||||
var extensions = new [] {
|
||||
new ExtensionFilter("Image Files", "png", "jpg", "jpeg" ),
|
||||
new ExtensionFilter("Sound Files", "mp3", "wav" ),
|
||||
new ExtensionFilter("All Files", "*" ),
|
||||
};
|
||||
WriteResult(StandaloneFileBrowser.OpenFilePanel("Open File", "", extensions, true));
|
||||
}
|
||||
|
||||
GUILayout.Space(15);
|
||||
|
||||
// Open Folder Samples
|
||||
|
||||
if (GUILayout.Button("Open Folder")) {
|
||||
var paths = StandaloneFileBrowser.OpenFolderPanel("Select Folder", "", true);
|
||||
WriteResult(paths);
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Open Folder Async")) {
|
||||
StandaloneFileBrowser.OpenFolderPanelAsync("Select Folder", "", true, (string[] paths) => { WriteResult(paths); });
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Open Folder Directory")) {
|
||||
var paths = StandaloneFileBrowser.OpenFolderPanel("Select Folder", Application.dataPath, true);
|
||||
WriteResult(paths);
|
||||
}
|
||||
|
||||
GUILayout.Space(15);
|
||||
|
||||
// Save File Samples
|
||||
|
||||
if (GUILayout.Button("Save File")) {
|
||||
_path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "", "");
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Save File Async")) {
|
||||
StandaloneFileBrowser.SaveFilePanelAsync("Save File", "", "", "", (string path) => { WriteResult(path); });
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Save File Default Name")) {
|
||||
_path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "MySaveFile", "");
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Save File Default Name Ext")) {
|
||||
_path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "MySaveFile", "dat");
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Save File Directory")) {
|
||||
_path = StandaloneFileBrowser.SaveFilePanel("Save File", Application.dataPath, "", "");
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
if (GUILayout.Button("Save File Filter")) {
|
||||
// Multiple save extension filters with more than one extension support.
|
||||
var extensionList = new [] {
|
||||
new ExtensionFilter("Binary", "bin"),
|
||||
new ExtensionFilter("Text", "txt"),
|
||||
};
|
||||
_path = StandaloneFileBrowser.SaveFilePanel("Save File", "", "MySaveFile", extensionList);
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(20);
|
||||
GUILayout.Label(_path);
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
public void WriteResult(string[] paths) {
|
||||
if (paths.Length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_path = "";
|
||||
foreach (var p in paths) {
|
||||
_path += p + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteResult(string path) {
|
||||
_path = path;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5148400295519405d82bb0fa65246ea2
|
||||
timeCreated: 1483902788
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 0
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 10
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 0
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &382763637
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 382763642}
|
||||
- component: {fileID: 382763641}
|
||||
- component: {fileID: 382763640}
|
||||
- component: {fileID: 382763639}
|
||||
- component: {fileID: 382763638}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &382763638
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 382763637}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &382763639
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 382763637}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &382763640
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 382763637}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &382763641
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 382763637}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &382763642
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 382763637}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &986049433
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 986049435}
|
||||
- component: {fileID: 986049434}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &986049434
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 986049433}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5148400295519405d82bb0fa65246ea2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!4 &986049435
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 986049433}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d97280fe82b874466870f709c3315d41
|
||||
timeCreated: 1483902786
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using SFB;
|
||||
|
||||
[RequireComponent(typeof(Button))]
|
||||
public class CanvasSampleOpenFileImage : MonoBehaviour, IPointerDownHandler {
|
||||
public RawImage output;
|
||||
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
//
|
||||
// WebGL
|
||||
//
|
||||
[DllImport("__Internal")]
|
||||
private static extern void UploadFile(string gameObjectName, string methodName, string filter, bool multiple);
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData) {
|
||||
UploadFile(gameObject.name, "OnFileUpload", ".png, .jpg", false);
|
||||
}
|
||||
|
||||
// Called from browser
|
||||
public void OnFileUpload(string url) {
|
||||
StartCoroutine(OutputRoutine(url));
|
||||
}
|
||||
#else
|
||||
//
|
||||
// Standalone platforms & editor
|
||||
//
|
||||
public void OnPointerDown(PointerEventData eventData) { }
|
||||
|
||||
void Start() {
|
||||
var button = GetComponent<Button>();
|
||||
button.onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
private void OnClick() {
|
||||
var paths = StandaloneFileBrowser.OpenFilePanel("Title", "", ".png", false);
|
||||
if (paths.Length > 0) {
|
||||
StartCoroutine(OutputRoutine(new System.Uri(paths[0]).AbsoluteUri));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private IEnumerator OutputRoutine(string url) {
|
||||
var loader = new WWW(url);
|
||||
yield return loader;
|
||||
output.texture = loader.texture;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 331c95b7bf39e4792acecff50a972040
|
||||
timeCreated: 1489946149
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using SFB;
|
||||
|
||||
[RequireComponent(typeof(Button))]
|
||||
public class CanvasSampleOpenFileText : MonoBehaviour, IPointerDownHandler {
|
||||
public Text output;
|
||||
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
//
|
||||
// WebGL
|
||||
//
|
||||
[DllImport("__Internal")]
|
||||
private static extern void UploadFile(string gameObjectName, string methodName, string filter, bool multiple);
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData) {
|
||||
UploadFile(gameObject.name, "OnFileUpload", ".txt", false);
|
||||
}
|
||||
|
||||
// Called from browser
|
||||
public void OnFileUpload(string url) {
|
||||
StartCoroutine(OutputRoutine(url));
|
||||
}
|
||||
#else
|
||||
//
|
||||
// Standalone platforms & editor
|
||||
//
|
||||
public void OnPointerDown(PointerEventData eventData) { }
|
||||
|
||||
void Start() {
|
||||
var button = GetComponent<Button>();
|
||||
button.onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
private void OnClick() {
|
||||
var paths = StandaloneFileBrowser.OpenFilePanel("Title", "", "txt", false);
|
||||
if (paths.Length > 0) {
|
||||
StartCoroutine(OutputRoutine(new System.Uri(paths[0]).AbsoluteUri));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private IEnumerator OutputRoutine(string url) {
|
||||
var loader = new WWW(url);
|
||||
yield return loader;
|
||||
output.text = loader.text;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 99a65d6437df64949b37cba4eadc67a2
|
||||
timeCreated: 1489946149
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using SFB;
|
||||
|
||||
[RequireComponent(typeof(Button))]
|
||||
public class CanvasSampleOpenFileTextMultiple : MonoBehaviour, IPointerDownHandler {
|
||||
public Text output;
|
||||
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
//
|
||||
// WebGL
|
||||
//
|
||||
[DllImport("__Internal")]
|
||||
private static extern void UploadFile(string gameObjectName, string methodName, string filter, bool multiple);
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData) {
|
||||
UploadFile(gameObject.name, "OnFileUpload", ".txt", true);
|
||||
}
|
||||
|
||||
// Called from browser
|
||||
public void OnFileUpload(string urls) {
|
||||
StartCoroutine(OutputRoutine(urls.Split(',')));
|
||||
}
|
||||
#else
|
||||
//
|
||||
// Standalone platforms & editor
|
||||
//
|
||||
public void OnPointerDown(PointerEventData eventData) { }
|
||||
|
||||
void Start() {
|
||||
var button = GetComponent<Button>();
|
||||
button.onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
private void OnClick() {
|
||||
// var paths = StandaloneFileBrowser.OpenFilePanel("Title", "", "txt", true);
|
||||
var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", "", true);
|
||||
if (paths.Length > 0) {
|
||||
var urlArr = new List<string>(paths.Length);
|
||||
for (int i = 0; i < paths.Length; i++) {
|
||||
urlArr.Add(new System.Uri(paths[i]).AbsoluteUri);
|
||||
}
|
||||
StartCoroutine(OutputRoutine(urlArr.ToArray()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private IEnumerator OutputRoutine(string[] urlArr) {
|
||||
var outputText = "";
|
||||
for (int i = 0; i < urlArr.Length; i++) {
|
||||
var loader = new WWW(urlArr[i]);
|
||||
yield return loader;
|
||||
outputText += loader.text;
|
||||
}
|
||||
output.text = outputText;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 71c09849449d61e47a4599e06b964998
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using SFB;
|
||||
|
||||
[RequireComponent(typeof(Button))]
|
||||
public class CanvasSampleSaveFileImage : MonoBehaviour, IPointerDownHandler {
|
||||
public Text output;
|
||||
|
||||
private byte[] _textureBytes;
|
||||
|
||||
void Awake() {
|
||||
// Create red texture
|
||||
var width = 100;
|
||||
var height = 100;
|
||||
Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false);
|
||||
for (int i = 0; i < width; i++) {
|
||||
for (int j = 0; j < height; j++) {
|
||||
tex.SetPixel(i, j, Color.red);
|
||||
}
|
||||
}
|
||||
tex.Apply();
|
||||
_textureBytes = tex.EncodeToPNG();
|
||||
UnityEngine.Object.Destroy(tex);
|
||||
}
|
||||
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
//
|
||||
// WebGL
|
||||
//
|
||||
[DllImport("__Internal")]
|
||||
private static extern void DownloadFile(string gameObjectName, string methodName, string filename, byte[] byteArray, int byteArraySize);
|
||||
|
||||
// Broser plugin should be called in OnPointerDown.
|
||||
public void OnPointerDown(PointerEventData eventData) {
|
||||
DownloadFile(gameObject.name, "OnFileDownload", "sample.png", _textureBytes, _textureBytes.Length);
|
||||
}
|
||||
|
||||
// Called from browser
|
||||
public void OnFileDownload() {
|
||||
output.text = "File Successfully Downloaded";
|
||||
}
|
||||
#else
|
||||
//
|
||||
// Standalone platforms & editor
|
||||
//
|
||||
public void OnPointerDown(PointerEventData eventData) { }
|
||||
|
||||
// Listen OnClick event in standlone builds
|
||||
void Start() {
|
||||
var button = GetComponent<Button>();
|
||||
button.onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
public void OnClick() {
|
||||
var path = StandaloneFileBrowser.SaveFilePanel("Title", "", "sample", "png");
|
||||
if (!string.IsNullOrEmpty(path)) {
|
||||
File.WriteAllBytes(path, _textureBytes);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6e681018aa67241a69b8447678ec3b4e
|
||||
timeCreated: 1489946149
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using SFB;
|
||||
|
||||
[RequireComponent(typeof(Button))]
|
||||
public class CanvasSampleSaveFileText : MonoBehaviour, IPointerDownHandler {
|
||||
public Text output;
|
||||
|
||||
// Sample text data
|
||||
private string _data = "Example text created by StandaloneFileBrowser";
|
||||
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
//
|
||||
// WebGL
|
||||
//
|
||||
[DllImport("__Internal")]
|
||||
private static extern void DownloadFile(string gameObjectName, string methodName, string filename, byte[] byteArray, int byteArraySize);
|
||||
|
||||
// Broser plugin should be called in OnPointerDown.
|
||||
public void OnPointerDown(PointerEventData eventData) {
|
||||
var bytes = Encoding.UTF8.GetBytes(_data);
|
||||
DownloadFile(gameObject.name, "OnFileDownload", "sample.txt", bytes, bytes.Length);
|
||||
}
|
||||
|
||||
// Called from browser
|
||||
public void OnFileDownload() {
|
||||
output.text = "File Successfully Downloaded";
|
||||
}
|
||||
#else
|
||||
//
|
||||
// Standalone platforms & editor
|
||||
//
|
||||
public void OnPointerDown(PointerEventData eventData) { }
|
||||
|
||||
// Listen OnClick event in standlone builds
|
||||
void Start() {
|
||||
var button = GetComponent<Button>();
|
||||
button.onClick.AddListener(OnClick);
|
||||
}
|
||||
|
||||
public void OnClick() {
|
||||
var path = StandaloneFileBrowser.SaveFilePanel("Title", "", "sample", "txt");
|
||||
if (!string.IsNullOrEmpty(path)) {
|
||||
File.WriteAllText(path, _data);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8e97f52f0bd664ee78305dae0094a755
|
||||
timeCreated: 1489946149
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c0e4eec5741834194a946535d535405c
|
||||
timeCreated: 1483902786
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
using System;
|
||||
|
||||
namespace SFB {
|
||||
public struct ExtensionFilter {
|
||||
public string Name;
|
||||
public string[] Extensions;
|
||||
|
||||
public ExtensionFilter(string filterName, params string[] filterExtensions) {
|
||||
Name = filterName;
|
||||
Extensions = filterExtensions;
|
||||
}
|
||||
}
|
||||
|
||||
public class StandaloneFileBrowser {
|
||||
private static IStandaloneFileBrowser _platformWrapper = null;
|
||||
|
||||
static StandaloneFileBrowser() {
|
||||
#if UNITY_STANDALONE_OSX
|
||||
_platformWrapper = new StandaloneFileBrowserMac();
|
||||
#elif UNITY_STANDALONE_WIN
|
||||
_platformWrapper = new StandaloneFileBrowserWindows();
|
||||
#elif UNITY_STANDALONE_LINUX
|
||||
_platformWrapper = new StandaloneFileBrowserLinux();
|
||||
#elif UNITY_EDITOR
|
||||
_platformWrapper = new StandaloneFileBrowserEditor();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native open file dialog
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="extension">Allowed extension</param>
|
||||
/// <param name="multiselect">Allow multiple file selection</param>
|
||||
/// <returns>Returns array of chosen paths. Zero length array when cancelled</returns>
|
||||
public static string[] OpenFilePanel(string title, string directory, string extension, bool multiselect) {
|
||||
var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) };
|
||||
return OpenFilePanel(title, directory, extensions, multiselect);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native open file dialog
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="extensions">List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png")</param>
|
||||
/// <param name="multiselect">Allow multiple file selection</param>
|
||||
/// <returns>Returns array of chosen paths. Zero length array when cancelled</returns>
|
||||
public static string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) {
|
||||
return _platformWrapper.OpenFilePanel(title, directory, extensions, multiselect);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native open file dialog async
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="extension">Allowed extension</param>
|
||||
/// <param name="multiselect">Allow multiple file selection</param>
|
||||
/// <param name="cb">Callback")</param>
|
||||
public static void OpenFilePanelAsync(string title, string directory, string extension, bool multiselect, Action<string[]> cb) {
|
||||
var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) };
|
||||
OpenFilePanelAsync(title, directory, extensions, multiselect, cb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native open file dialog async
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="extensions">List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png")</param>
|
||||
/// <param name="multiselect">Allow multiple file selection</param>
|
||||
/// <param name="cb">Callback")</param>
|
||||
public static void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action<string[]> cb) {
|
||||
_platformWrapper.OpenFilePanelAsync(title, directory, extensions, multiselect, cb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native open folder dialog
|
||||
/// NOTE: Multiple folder selection doesn't supported on Windows
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="multiselect"></param>
|
||||
/// <returns>Returns array of chosen paths. Zero length array when cancelled</returns>
|
||||
public static string[] OpenFolderPanel(string title, string directory, bool multiselect) {
|
||||
return _platformWrapper.OpenFolderPanel(title, directory, multiselect);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native open folder dialog async
|
||||
/// NOTE: Multiple folder selection doesn't supported on Windows
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="multiselect"></param>
|
||||
/// <param name="cb">Callback")</param>
|
||||
public static void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action<string[]> cb) {
|
||||
_platformWrapper.OpenFolderPanelAsync(title, directory, multiselect, cb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native save file dialog
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="defaultName">Default file name</param>
|
||||
/// <param name="extension">File extension</param>
|
||||
/// <returns>Returns chosen path. Empty string when cancelled</returns>
|
||||
public static string SaveFilePanel(string title, string directory, string defaultName , string extension) {
|
||||
var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) };
|
||||
return SaveFilePanel(title, directory, defaultName, extensions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native save file dialog
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="defaultName">Default file name</param>
|
||||
/// <param name="extensions">List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png")</param>
|
||||
/// <returns>Returns chosen path. Empty string when cancelled</returns>
|
||||
public static string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) {
|
||||
return _platformWrapper.SaveFilePanel(title, directory, defaultName, extensions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native save file dialog async
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="defaultName">Default file name</param>
|
||||
/// <param name="extension">File extension</param>
|
||||
/// <param name="cb">Callback")</param>
|
||||
public static void SaveFilePanelAsync(string title, string directory, string defaultName , string extension, Action<string> cb) {
|
||||
var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) };
|
||||
SaveFilePanelAsync(title, directory, defaultName, extensions, cb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Native save file dialog async
|
||||
/// </summary>
|
||||
/// <param name="title">Dialog title</param>
|
||||
/// <param name="directory">Root directory</param>
|
||||
/// <param name="defaultName">Default file name</param>
|
||||
/// <param name="extensions">List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png")</param>
|
||||
/// <param name="cb">Callback")</param>
|
||||
public static void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action<string> cb) {
|
||||
_platformWrapper.SaveFilePanelAsync(title, directory, defaultName, extensions, cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3c708be74128e4ced9b79eaaf80e8443
|
||||
timeCreated: 1483902788
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
#if UNITY_EDITOR
|
||||
|
||||
using System;
|
||||
using UnityEditor;
|
||||
|
||||
namespace SFB {
|
||||
public class StandaloneFileBrowserEditor : IStandaloneFileBrowser {
|
||||
public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) {
|
||||
string path = "";
|
||||
|
||||
if (extensions == null) {
|
||||
path = EditorUtility.OpenFilePanel(title, directory, "");
|
||||
}
|
||||
else {
|
||||
path = EditorUtility.OpenFilePanelWithFilters(title, directory, GetFilterFromFileExtensionList(extensions));
|
||||
}
|
||||
|
||||
return string.IsNullOrEmpty(path) ? new string[0] : new[] { path };
|
||||
}
|
||||
|
||||
public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action<string[]> cb) {
|
||||
cb.Invoke(OpenFilePanel(title, directory, extensions, multiselect));
|
||||
}
|
||||
|
||||
public string[] OpenFolderPanel(string title, string directory, bool multiselect) {
|
||||
var path = EditorUtility.OpenFolderPanel(title, directory, "");
|
||||
return string.IsNullOrEmpty(path) ? new string[0] : new[] {path};
|
||||
}
|
||||
|
||||
public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action<string[]> cb) {
|
||||
cb.Invoke(OpenFolderPanel(title, directory, multiselect));
|
||||
}
|
||||
|
||||
public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) {
|
||||
var ext = extensions != null ? extensions[0].Extensions[0] : "";
|
||||
var name = string.IsNullOrEmpty(ext) ? defaultName : defaultName + "." + ext;
|
||||
return EditorUtility.SaveFilePanel(title, directory, name, ext);
|
||||
}
|
||||
|
||||
public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action<string> cb) {
|
||||
cb.Invoke(SaveFilePanel(title, directory, defaultName, extensions));
|
||||
}
|
||||
|
||||
// EditorUtility.OpenFilePanelWithFilters extension filter format
|
||||
private static string[] GetFilterFromFileExtensionList(ExtensionFilter[] extensions) {
|
||||
var filters = new string[extensions.Length * 2];
|
||||
for (int i = 0; i < extensions.Length; i++) {
|
||||
filters[(i * 2)] = extensions[i].Name;
|
||||
filters[(i * 2) + 1] = string.Join(",", extensions[i].Extensions);
|
||||
}
|
||||
return filters;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2650af8de2cda46b99b1bc7cf5d30ca5
|
||||
timeCreated: 1483902788
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
#if UNITY_STANDALONE_LINUX
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SFB {
|
||||
|
||||
public class StandaloneFileBrowserLinux : IStandaloneFileBrowser {
|
||||
|
||||
private static Action<string[]> _openFileCb;
|
||||
private static Action<string[]> _openFolderCb;
|
||||
private static Action<string> _saveFileCb;
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void AsyncCallback(string path);
|
||||
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern void DialogInit();
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern IntPtr DialogOpenFilePanel(string title, string directory, string extension, bool multiselect);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern void DialogOpenFilePanelAsync(string title, string directory, string extension, bool multiselect, AsyncCallback callback);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern IntPtr DialogOpenFolderPanel(string title, string directory, bool multiselect);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern void DialogOpenFolderPanelAsync(string title, string directory, bool multiselect, AsyncCallback callback);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern IntPtr DialogSaveFilePanel(string title, string directory, string defaultName, string extension);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern void DialogSaveFilePanelAsync(string title, string directory, string defaultName, string extension, AsyncCallback callback);
|
||||
|
||||
public StandaloneFileBrowserLinux()
|
||||
{
|
||||
DialogInit();
|
||||
}
|
||||
|
||||
public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) {
|
||||
var paths = Marshal.PtrToStringAnsi(DialogOpenFilePanel(
|
||||
title,
|
||||
directory,
|
||||
GetFilterFromFileExtensionList(extensions),
|
||||
multiselect));
|
||||
return paths.Split((char)28);
|
||||
}
|
||||
|
||||
public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action<string[]> cb) {
|
||||
_openFileCb = cb;
|
||||
DialogOpenFilePanelAsync(
|
||||
title,
|
||||
directory,
|
||||
GetFilterFromFileExtensionList(extensions),
|
||||
multiselect,
|
||||
(string result) => { _openFileCb.Invoke(result.Split((char)28)); });
|
||||
}
|
||||
|
||||
public string[] OpenFolderPanel(string title, string directory, bool multiselect) {
|
||||
var paths = Marshal.PtrToStringAnsi(DialogOpenFolderPanel(
|
||||
title,
|
||||
directory,
|
||||
multiselect));
|
||||
return paths.Split((char)28);
|
||||
}
|
||||
|
||||
public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action<string[]> cb) {
|
||||
_openFolderCb = cb;
|
||||
DialogOpenFolderPanelAsync(
|
||||
title,
|
||||
directory,
|
||||
multiselect,
|
||||
(string result) => { _openFolderCb.Invoke(result.Split((char)28)); });
|
||||
}
|
||||
|
||||
public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) {
|
||||
return Marshal.PtrToStringAnsi(DialogSaveFilePanel(
|
||||
title,
|
||||
directory,
|
||||
defaultName,
|
||||
GetFilterFromFileExtensionList(extensions)));
|
||||
}
|
||||
|
||||
public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action<string> cb) {
|
||||
_saveFileCb = cb;
|
||||
DialogSaveFilePanelAsync(
|
||||
title,
|
||||
directory,
|
||||
defaultName,
|
||||
GetFilterFromFileExtensionList(extensions),
|
||||
(string result) => { _saveFileCb.Invoke(result); });
|
||||
}
|
||||
|
||||
private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) {
|
||||
if (extensions == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
var filterString = "";
|
||||
foreach (var filter in extensions) {
|
||||
filterString += filter.Name + ";";
|
||||
|
||||
foreach (var ext in filter.Extensions) {
|
||||
filterString += ext + ",";
|
||||
}
|
||||
|
||||
filterString = filterString.Remove(filterString.Length - 1);
|
||||
filterString += "|";
|
||||
}
|
||||
filterString = filterString.Remove(filterString.Length - 1);
|
||||
return filterString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5d3a668018554b8a89c3fe12de72b60c
|
||||
timeCreated: 1538067919
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
#if UNITY_STANDALONE_OSX
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SFB {
|
||||
public class StandaloneFileBrowserMac : IStandaloneFileBrowser {
|
||||
private static Action<string[]> _openFileCb;
|
||||
private static Action<string[]> _openFolderCb;
|
||||
private static Action<string> _saveFileCb;
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void AsyncCallback(string path);
|
||||
|
||||
[AOT.MonoPInvokeCallback(typeof(AsyncCallback))]
|
||||
private static void openFileCb(string result) {
|
||||
_openFileCb.Invoke(result.Split((char)28));
|
||||
}
|
||||
|
||||
[AOT.MonoPInvokeCallback(typeof(AsyncCallback))]
|
||||
private static void openFolderCb(string result) {
|
||||
_openFolderCb.Invoke(result.Split((char)28));
|
||||
}
|
||||
|
||||
[AOT.MonoPInvokeCallback(typeof(AsyncCallback))]
|
||||
private static void saveFileCb(string result) {
|
||||
_saveFileCb.Invoke(result);
|
||||
}
|
||||
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern IntPtr DialogOpenFilePanel(string title, string directory, string extension, bool multiselect);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern void DialogOpenFilePanelAsync(string title, string directory, string extension, bool multiselect, AsyncCallback callback);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern IntPtr DialogOpenFolderPanel(string title, string directory, bool multiselect);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern void DialogOpenFolderPanelAsync(string title, string directory, bool multiselect, AsyncCallback callback);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern IntPtr DialogSaveFilePanel(string title, string directory, string defaultName, string extension);
|
||||
[DllImport("StandaloneFileBrowser")]
|
||||
private static extern void DialogSaveFilePanelAsync(string title, string directory, string defaultName, string extension, AsyncCallback callback);
|
||||
|
||||
public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) {
|
||||
var paths = Marshal.PtrToStringAnsi(DialogOpenFilePanel(
|
||||
title,
|
||||
directory,
|
||||
GetFilterFromFileExtensionList(extensions),
|
||||
multiselect));
|
||||
return paths.Split((char)28);
|
||||
}
|
||||
|
||||
public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action<string[]> cb) {
|
||||
_openFileCb = cb;
|
||||
DialogOpenFilePanelAsync(
|
||||
title,
|
||||
directory,
|
||||
GetFilterFromFileExtensionList(extensions),
|
||||
multiselect,
|
||||
openFileCb);
|
||||
}
|
||||
|
||||
public string[] OpenFolderPanel(string title, string directory, bool multiselect) {
|
||||
var paths = Marshal.PtrToStringAnsi(DialogOpenFolderPanel(
|
||||
title,
|
||||
directory,
|
||||
multiselect));
|
||||
return paths.Split((char)28);
|
||||
}
|
||||
|
||||
public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action<string[]> cb) {
|
||||
_openFolderCb = cb;
|
||||
DialogOpenFolderPanelAsync(
|
||||
title,
|
||||
directory,
|
||||
multiselect,
|
||||
openFolderCb);
|
||||
}
|
||||
|
||||
public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) {
|
||||
return Marshal.PtrToStringAnsi(DialogSaveFilePanel(
|
||||
title,
|
||||
directory,
|
||||
defaultName,
|
||||
GetFilterFromFileExtensionList(extensions)));
|
||||
}
|
||||
|
||||
public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action<string> cb) {
|
||||
_saveFileCb = cb;
|
||||
DialogSaveFilePanelAsync(
|
||||
title,
|
||||
directory,
|
||||
defaultName,
|
||||
GetFilterFromFileExtensionList(extensions),
|
||||
saveFileCb);
|
||||
}
|
||||
|
||||
private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) {
|
||||
if (extensions == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
var filterString = "";
|
||||
foreach (var filter in extensions) {
|
||||
filterString += filter.Name + ";";
|
||||
|
||||
foreach (var ext in filter.Extensions) {
|
||||
filterString += ext + ",";
|
||||
}
|
||||
|
||||
filterString = filterString.Remove(filterString.Length - 1);
|
||||
filterString += "|";
|
||||
}
|
||||
filterString = filterString.Remove(filterString.Length - 1);
|
||||
return filterString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bcb49ddb0ed5644fda9c3b055cafa27a
|
||||
timeCreated: 1483902788
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
#if UNITY_STANDALONE_WIN
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Runtime.InteropServices;
|
||||
using Ookii.Dialogs;
|
||||
|
||||
namespace SFB {
|
||||
// For fullscreen support
|
||||
// - WindowWrapper class and GetActiveWindow() are required for modal file dialog.
|
||||
// - "PlayerSettings/Visible In Background" should be enabled, otherwise when file dialog opened app window minimizes automatically.
|
||||
|
||||
public class WindowWrapper : IWin32Window {
|
||||
private IntPtr _hwnd;
|
||||
public WindowWrapper(IntPtr handle) { _hwnd = handle; }
|
||||
public IntPtr Handle { get { return _hwnd; } }
|
||||
}
|
||||
|
||||
public class StandaloneFileBrowserWindows : IStandaloneFileBrowser {
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetActiveWindow();
|
||||
|
||||
public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) {
|
||||
var fd = new VistaOpenFileDialog();
|
||||
fd.Title = title;
|
||||
if (extensions != null) {
|
||||
fd.Filter = GetFilterFromFileExtensionList(extensions);
|
||||
fd.FilterIndex = 1;
|
||||
}
|
||||
else {
|
||||
fd.Filter = string.Empty;
|
||||
}
|
||||
fd.Multiselect = multiselect;
|
||||
if (!string.IsNullOrEmpty(directory)) {
|
||||
fd.FileName = GetDirectoryPath(directory);
|
||||
}
|
||||
var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
|
||||
var filenames = res == DialogResult.OK ? fd.FileNames : new string[0];
|
||||
fd.Dispose();
|
||||
return filenames;
|
||||
}
|
||||
|
||||
public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action<string[]> cb) {
|
||||
cb.Invoke(OpenFilePanel(title, directory, extensions, multiselect));
|
||||
}
|
||||
|
||||
public string[] OpenFolderPanel(string title, string directory, bool multiselect) {
|
||||
var fd = new VistaFolderBrowserDialog();
|
||||
fd.Description = title;
|
||||
if (!string.IsNullOrEmpty(directory)) {
|
||||
fd.SelectedPath = GetDirectoryPath(directory);
|
||||
}
|
||||
var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
|
||||
var filenames = res == DialogResult.OK ? new []{ fd.SelectedPath } : new string[0];
|
||||
fd.Dispose();
|
||||
return filenames;
|
||||
}
|
||||
|
||||
public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action<string[]> cb) {
|
||||
cb.Invoke(OpenFolderPanel(title, directory, multiselect));
|
||||
}
|
||||
|
||||
public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) {
|
||||
var fd = new VistaSaveFileDialog();
|
||||
fd.Title = title;
|
||||
|
||||
var finalFilename = "";
|
||||
|
||||
if (!string.IsNullOrEmpty(directory)) {
|
||||
finalFilename = GetDirectoryPath(directory);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(defaultName)) {
|
||||
finalFilename += defaultName;
|
||||
}
|
||||
|
||||
fd.FileName = finalFilename;
|
||||
if (extensions != null) {
|
||||
fd.Filter = GetFilterFromFileExtensionList(extensions);
|
||||
fd.FilterIndex = 1;
|
||||
fd.DefaultExt = extensions[0].Extensions[0];
|
||||
fd.AddExtension = true;
|
||||
}
|
||||
else {
|
||||
fd.DefaultExt = string.Empty;
|
||||
fd.Filter = string.Empty;
|
||||
fd.AddExtension = false;
|
||||
}
|
||||
var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
|
||||
var filename = res == DialogResult.OK ? fd.FileName : "";
|
||||
fd.Dispose();
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action<string> cb) {
|
||||
cb.Invoke(SaveFilePanel(title, directory, defaultName, extensions));
|
||||
}
|
||||
|
||||
// .NET Framework FileDialog Filter format
|
||||
// https://msdn.microsoft.com/en-us/library/microsoft.win32.filedialog.filter
|
||||
private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) {
|
||||
var filterString = "";
|
||||
foreach (var filter in extensions) {
|
||||
filterString += filter.Name + "(";
|
||||
|
||||
foreach (var ext in filter.Extensions) {
|
||||
filterString += "*." + ext + ",";
|
||||
}
|
||||
|
||||
filterString = filterString.Remove(filterString.Length - 1);
|
||||
filterString += ") |";
|
||||
|
||||
foreach (var ext in filter.Extensions) {
|
||||
filterString += "*." + ext + "; ";
|
||||
}
|
||||
|
||||
filterString += "|";
|
||||
}
|
||||
filterString = filterString.Remove(filterString.Length - 1);
|
||||
return filterString;
|
||||
}
|
||||
|
||||
private static string GetDirectoryPath(string directory) {
|
||||
var directoryPath = Path.GetFullPath(directory);
|
||||
if (!directoryPath.EndsWith("\\")) {
|
||||
directoryPath += "\\";
|
||||
}
|
||||
if (Path.GetPathRoot(directoryPath) == directoryPath) {
|
||||
return directory;
|
||||
}
|
||||
return Path.GetDirectoryName(directoryPath) + Path.DirectorySeparatorChar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 194e247414a78461d83ae606c1b96917
|
||||
timeCreated: 1483902788
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 067646a5f59040644bf3b14d0c54fa5f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"records": [
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}, {
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 568c82c743178624cbd6a792345db5c2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"records": [
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 51abc03adec8228428c8e1060a13000c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -3,14 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 11.00
|
|||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NaughtyAttributes.Core", "NaughtyAttributes.Core.csproj", "{b366c870-8269-aeae-4186-8220020279aa}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{edefe799-dc28-4dd2-3165-1acb9e1a5d82}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask.Linq", "UniTask.Linq.csproj", "{e8ea8a32-db36-1909-a8a7-26f06060f4d3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-firstpass", "Assembly-CSharp-firstpass.csproj", "{a90e88d8-badb-4199-850a-29eeee6b3832}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask", "UniTask.csproj", "{2fd61c43-4224-9fcb-8a4a-9397608e2318}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{edefe799-dc28-4dd2-3165-1acb9e1a5d82}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NaughtyAttributes.Test", "NaughtyAttributes.Test.csproj", "{775d4e80-7b8a-c113-e64a-f0327b5a51d2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NaughtyAttributes.Editor", "NaughtyAttributes.Editor.csproj", "{7c2f9189-479d-675c-b95e-c95f88c2a560}"
|
||||
|
|
@ -34,14 +34,14 @@ Global
|
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{b366c870-8269-aeae-4186-8220020279aa}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{b366c870-8269-aeae-4186-8220020279aa}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{edefe799-dc28-4dd2-3165-1acb9e1a5d82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{edefe799-dc28-4dd2-3165-1acb9e1a5d82}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{e8ea8a32-db36-1909-a8a7-26f06060f4d3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{e8ea8a32-db36-1909-a8a7-26f06060f4d3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{a90e88d8-badb-4199-850a-29eeee6b3832}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{a90e88d8-badb-4199-850a-29eeee6b3832}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2fd61c43-4224-9fcb-8a4a-9397608e2318}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2fd61c43-4224-9fcb-8a4a-9397608e2318}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{edefe799-dc28-4dd2-3165-1acb9e1a5d82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{edefe799-dc28-4dd2-3165-1acb9e1a5d82}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{775d4e80-7b8a-c113-e64a-f0327b5a51d2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{775d4e80-7b8a-c113-e64a-f0327b5a51d2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7c2f9189-479d-675c-b95e-c95f88c2a560}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"records": [
|
||||
{
|
||||
"content": "的撒大苏打实打实的啊啥的啊啥的啊啥的啊啥的啊啥的"
|
||||
},
|
||||
{
|
||||
"content": "啊啥的啊啥的啊啥的"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue