Skip to content

Commit 872513a

Browse files
authored
Merge pull request #7 from asus4/upgrade-to-upm
Upgrade to UPM
2 parents bc7cba2 + 620e53f commit 872513a

39 files changed

Lines changed: 2760 additions & 533 deletions

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013 Koki Ibukuro
3+
Copyright (c) 2021 Koki Ibukuro
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

unity/NativeDialogPlugin/.gitignore

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,78 @@ Temp
44
*.sln
55
*.pidb
66
*.userprefs
7-
*.unityproj
7+
*.unityproj### https://raw.github.com/github/gitignore/cdd9e946da421758c6f42c427c7bc65c8326155d/Unity.gitignore
8+
9+
# This .gitignore file should be placed at the root of your Unity project directory
10+
#
11+
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
12+
#
13+
/[Ll]ibrary/
14+
/[Tt]emp/
15+
/[Oo]bj/
16+
/[Bb]uild/
17+
/[Bb]uilds/
18+
/[Ll]ogs/
19+
/[Uu]ser[Ss]ettings/
20+
21+
# MemoryCaptures can get excessive in size.
22+
# They also could contain extremely sensitive data
23+
/[Mm]emoryCaptures/
24+
25+
# Asset meta data should only be ignored when the corresponding asset is also ignored
26+
!/[Aa]ssets/**/*.meta
27+
28+
# Uncomment this line if you wish to ignore the asset store tools plugin
29+
# /[Aa]ssets/AssetStoreTools*
30+
31+
# Autogenerated Jetbrains Rider plugin
32+
/[Aa]ssets/Plugins/Editor/JetBrains*
33+
34+
# Visual Studio cache directory
35+
.vs/
36+
37+
# Gradle cache directory
38+
.gradle/
39+
40+
# Autogenerated VS/MD/Consulo solution and project files
41+
ExportedObj/
42+
.consulo/
43+
*.csproj
44+
*.unityproj
45+
*.sln
46+
*.suo
47+
*.tmp
48+
*.user
49+
*.userprefs
50+
*.pidb
51+
*.booproj
52+
*.svd
53+
*.pdb
54+
*.mdb
55+
*.opendb
56+
*.VC.db
57+
58+
# Unity3D generated meta files
59+
*.pidb.meta
60+
*.pdb.meta
61+
*.mdb.meta
62+
63+
# Unity3D generated file on crash reports
64+
sysinfo.txt
65+
66+
# Builds
67+
*.apk
68+
*.aab
69+
*.unitypackage
70+
71+
# Crashlytics generated file
72+
crashlytics-build.properties
73+
74+
# Packed Addressables
75+
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
76+
77+
# Temporary auto-generated Android Assets
78+
/[Aa]ssets/[Ss]treamingAssets/aa.meta
79+
/[Aa]ssets/[Ss]treamingAssets/aa/*
80+
81+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
using UnityEngine;
2+
using System.Collections;
3+
using NativeDialog;
4+
5+
public class NativeDialogSample : MonoBehaviour
6+
{
7+
[SerializeField] private string decideLabel = "Decide";
8+
[SerializeField] private string cancelLabel = "Cancel";
9+
[SerializeField] private string closeLabel = "Close";
10+
11+
private void Start()
12+
{
13+
DialogManager.Instance.SetLabel(decideLabel, cancelLabel, closeLabel);
14+
}
15+
16+
#region Invoked from Unity GUI
17+
18+
public void ShowSelectDialog()
19+
{
20+
const string message = "A simple select dialog";
21+
DialogManager.Instance.ShowSelectDialog(message, (bool result) =>
22+
{
23+
Debug.Log($"{result}: {message}");
24+
});
25+
}
26+
27+
public void ShowSelectDialogWithTitle()
28+
{
29+
const string title = "A title";
30+
const string message = "A message for select dialog";
31+
DialogManager.Instance.ShowSelectDialog(title, message, (bool result) =>
32+
{
33+
Debug.Log($"{result}: {title} / {message}");
34+
});
35+
}
36+
37+
public void ShowSubmitDialog()
38+
{
39+
const string message = "A simple submit dialog";
40+
DialogManager.Instance.ShowSubmitDialog(message, (bool result) =>
41+
{
42+
Debug.Log($"{result}: {message}");
43+
});
44+
}
45+
46+
public void ShowSubmitDialogWithTitle()
47+
{
48+
const string title = "A title";
49+
const string message = "A message for submit dialog";
50+
DialogManager.Instance.ShowSubmitDialog(title, message, (bool result) =>
51+
{
52+
Debug.Log($"{result}: {title} / {message}");
53+
});
54+
}
55+
56+
public void ShowDialogWithAutoDissmiss()
57+
{
58+
const string message = "A dialog with auto dismiss";
59+
int id = DialogManager.Instance.ShowSelectDialog(message, (bool result) =>
60+
{
61+
Debug.Log($"{result}: {message}");
62+
});
63+
StartCoroutine(Dissmiss(id, 3f));
64+
}
65+
66+
#endregion // Invoked from Unity GUI
67+
68+
private IEnumerator Dissmiss(int id, float time)
69+
{
70+
yield return new WaitForSeconds(time);
71+
DialogManager.Instance.DissmissDialog(id);
72+
}
73+
}
File renamed without changes.

0 commit comments

Comments
 (0)