-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestExample.cs
More file actions
47 lines (33 loc) · 1.11 KB
/
Copy pathTestExample.cs
File metadata and controls
47 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using UnityEngine;
using UnityEngine.UI;
namespace Geekbrains.Test
{
internal sealed class TestExample
{
public delegate void TestDelegate(string value); // 1
private TestDelegate _testDelegate; // 2
private string _money ="9999999999999999999 рублей";
private Button _button;
private void NameMethod()
{
_testDelegate += TestDelegateMethod; // 3
#region MyRegion
_testDelegate += t => { Debug.Log(t); };
_testDelegate += delegate(string value) { Debug.Log(value); };
#endregion
#region MyRegion
_button.onClick.AddListener(() => Debug.Log(3));
_button.onClick.RemoveAllListeners();
#endregion
_testDelegate("454"); // 4
}
public void GetMoney(TestDelegate testDelegate)
{
testDelegate?.Invoke(_money);
}
private void TestDelegateMethod(string value)
{
throw new System.NotImplementedException();
}
}
}