init uniWindowController 0.9.8
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"displayName": "FileDialog",
|
||||
"description": "Demonstrates native file open/save dialog integration.",
|
||||
"createSeparatePackage": false
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Kirurobo
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础文件面板示例
|
||||
/// </summary>
|
||||
public class FileDialogSample : MonoBehaviour
|
||||
{
|
||||
public Button openFileButton;
|
||||
public Button openMultipleFilesButton;
|
||||
public Button saveFileButton;
|
||||
public Text messageText;
|
||||
|
||||
// 首次更新前调用 Start
|
||||
void Start()
|
||||
{
|
||||
openFileButton.onClick.AddListener(OpenSingleFile);
|
||||
openMultipleFilesButton.onClick.AddListener(OpenMultipleFiles);
|
||||
saveFileButton.onClick.AddListener(OpenSaveFile);
|
||||
messageText.text = "点击按钮!";
|
||||
}
|
||||
|
||||
// 每帧调用 Update
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开单个文件的对话框。
|
||||
/// </summary>
|
||||
private void OpenSingleFile() {
|
||||
FilePanel.Settings settings = new FilePanel.Settings();
|
||||
settings.filters = new FilePanel.Filter[]
|
||||
{
|
||||
new FilePanel.Filter("所有文件", "*"),
|
||||
new FilePanel.Filter("图片文件 (*.png;*.jpg;*.jpeg;*.tiff;*.gif;*.tga)", "png", "jpg", "jpeg", "tiff", "gif", "tga"),
|
||||
new FilePanel.Filter("文档 (*.txt;*.rtf;*.doc;*.docx)", "txt", "rtf", "doc", "docx"),
|
||||
};
|
||||
settings.title = "打开文件!";
|
||||
settings.initialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures);
|
||||
|
||||
messageText.text = "";
|
||||
FilePanel.OpenFilePanel(settings, (files) =>
|
||||
{
|
||||
messageText.text = "打开文件\n" + string.Join("\n", files);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开多个文件的对话框。
|
||||
/// </summary>
|
||||
private void OpenMultipleFiles() {
|
||||
FilePanel.Settings settings = new FilePanel.Settings();
|
||||
settings.filters = new FilePanel.Filter[]
|
||||
{
|
||||
new FilePanel.Filter("图片文件 (*.png;*.jpg;*.jpeg;*.tiff;*.gif;*.tga)", "png", "jpg", "jpeg", "tiff", "gif", "tga"),
|
||||
new FilePanel.Filter("文档 (*.txt;*.rtf;*.doc;*.docx)", "txt", "rtf", "doc", "docx"),
|
||||
new FilePanel.Filter("所有文件", "*"),
|
||||
};
|
||||
settings.flags = FilePanel.Flag.AllowMultipleSelection;
|
||||
settings.title = "打开多个文件!";
|
||||
settings.initialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
|
||||
|
||||
messageText.text = "";
|
||||
FilePanel.OpenFilePanel(settings, (files) =>
|
||||
{
|
||||
messageText.text = "打开多个文件\n" + string.Join("\n", files);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开保存文件对话框。
|
||||
/// </summary>
|
||||
private void OpenSaveFile() {
|
||||
FilePanel.Settings settings = new FilePanel.Settings();
|
||||
settings.filters = new FilePanel.Filter[]
|
||||
{
|
||||
new FilePanel.Filter("文本文件 (*.txt;*.log)", "txt", "log"),
|
||||
new FilePanel.Filter("图片文件 (*.png;*.jpg;*.jpeg;*.tiff;*.gif;*.tga)", "png", "jpg", "jpeg", "tiff", "gif", "tga"),
|
||||
new FilePanel.Filter("所有文件", "*"),
|
||||
};
|
||||
settings.title = "实际上不会执行保存操作";
|
||||
settings.initialFile = "Test.txt";
|
||||
|
||||
messageText.text = "";
|
||||
FilePanel.SaveFilePanel(settings, (files) =>
|
||||
{
|
||||
messageText.text = "选中的文件\n" + string.Join("\n", files);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,63 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!850595691 &4890085278179872738
|
||||
LightingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: FileDialogSampleSettings
|
||||
serializedVersion: 3
|
||||
m_GIWorkflowMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_RealtimeEnvironmentLighting: 1
|
||||
m_BounceScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_UsingShadowmask: 1
|
||||
m_BakeBackend: 1
|
||||
m_LightmapMaxSize: 1024
|
||||
m_BakeResolution: 40
|
||||
m_Padding: 2
|
||||
m_TextureCompression: 1
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAO: 0
|
||||
m_MixedBakeMode: 2
|
||||
m_LightmapsBakeMode: 1
|
||||
m_FilterMode: 1
|
||||
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_RealtimeResolution: 2
|
||||
m_ForceWhiteAlbedo: 0
|
||||
m_ForceUpdates: 0
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherRayCount: 256
|
||||
m_FinalGatherFiltering: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_PVRBounces: 2
|
||||
m_PVRMinBounces: 2
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
Reference in New Issue
Block a user