Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
curvedflats
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Flatland
curvedflats
Commits
5fee82db
Commit
5fee82db
authored
Aug 22, 2019
by
16이진형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
알람 여러개
parent
2870cd0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
28 deletions
+92
-28
AlertManager.cs
Assets/AlertManager.cs
+41
-2
Test.unity
Assets/Scenes/Test.unity
+51
-26
No files found.
Assets/AlertManager.cs
View file @
5fee82db
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.Events
;
using
UnityEngine.UI
;
public
class
AlertManager
:
MonoBehaviour
...
...
@@ -13,11 +14,15 @@ public class AlertManager : MonoBehaviour
Button
cancelButton
;
[
SerializeField
]
Text
alertText
;
Queue
<
string
>
alertTextQueue
;
// Start is called before the first frame update
void
Start
()
{
Close
();
Alert
(
"test"
);
string
[]
aa
=
{
"a"
,
"b"
};
Alert
(
aa
);
}
// Update is called once per frame
...
...
@@ -26,12 +31,46 @@ public class AlertManager : MonoBehaviour
}
public
void
Alert
(
string
text
)
public
void
Alert
(
string
text
,
UnityAction
ok
=
null
,
UnityAction
cancel
=
null
)
{
Open
();
alertText
.
text
=
text
;
okButton
.
onClick
.
AddListener
(
Close
);
cancelButton
.
onClick
.
AddListener
(
Close
);
if
(
ok
!=
null
)
{
okButton
.
onClick
.
AddListener
(
ok
);
}
if
(
cancel
!=
null
)
{
cancelButton
.
onClick
.
AddListener
(
cancel
);
}
}
public
void
Alert
(
IList
<
string
>
texts
)
{
alertTextQueue
=
new
Queue
<
string
>(
texts
);
AlertQueue
();
}
public
void
AlertQueue
()
{
if
(
alertTextQueue
.
Count
>=
2
)
{
Alert
(
alertTextQueue
.
Dequeue
(),
AlertQueue
,
DeleteQueue
);
}
else
{
Alert
(
alertTextQueue
.
Dequeue
());
}
}
public
void
DeleteQueue
()
{
alertTextQueue
.
Clear
();
}
public
void
Open
()
...
...
Assets/Scenes/Test.unity
View file @
5fee82db
...
...
@@ -1558,7 +1558,7 @@ GameObject:
-
component
:
{
fileID
:
798238902
}
-
component
:
{
fileID
:
798238901
}
m_Layer
:
5
m_Name: Al
arm
Text
m_Name
:
Al
ert
Text
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
...
...
@@ -2398,18 +2398,7 @@ MonoBehaviour:
m_TargetGraphic
:
{
fileID
:
998772547
}
m_OnClick
:
m_PersistentCalls
:
m_Calls:
- m_Target: {fileID: 394305455}
m_MethodName: PathCancel
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls
:
[]
m_TypeName
:
UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
---
!u!114
&998772547
...
...
@@ -3876,7 +3865,7 @@ GameObject:
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive:
0
m_IsActive
:
1
---
!u!114
&1496132463
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
@@ -4212,18 +4201,7 @@ MonoBehaviour:
m_TargetGraphic
:
{
fileID
:
1691280424
}
m_OnClick
:
m_PersistentCalls
:
m_Calls:
- m_Target: {fileID: 394305455}
m_MethodName: PathStart
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls
:
[]
m_TypeName
:
UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
---
!u!114
&1691280424
...
...
@@ -4744,6 +4722,53 @@ CanvasRenderer:
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1782632031
}
m_CullTransparentMesh
:
0
---
!u!1
&1878497985
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1878497987
}
-
component
:
{
fileID
:
1878497986
}
m_Layer
:
0
m_Name
:
AlertManager
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&1878497986
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1878497985
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
fe82d3fd30784eb47b1817cc46e1e205
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
alertObject
:
{
fileID
:
798238899
}
okButton
:
{
fileID
:
1691280423
}
cancelButton
:
{
fileID
:
998772546
}
alertText
:
{
fileID
:
1063558149
}
---
!u!4
&1878497987
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1878497985
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
310.89844
,
y
:
172.87187
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
14
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&1883174027
GameObject
:
m_ObjectHideFlags
:
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment