Fails









How do I use Fails
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: INetworkService.cs Copy
11         Signal OnConnectionFailSignal { get; }
File name: NetworkAdapter.cs Copy
15         public Signal OnConnectionFailSignal { get; private set; }
File name: NetworkAdapter.cs Copy
138         private void Awake()
139         {
140             OnBeginConnectingSignal = new Signal();
141             OnConnectedToMasterSignal = new Signal();
142             OnDisconnectedFromMasterSignal = new Signal();
143             OnConnectionFailSignal = new Signal();
144             OnJoinedRoomSignal = new Signal();
145             OnAllPlayersConnectedSignal = new Signal();
146             OnRemoteBoardChangeSignal = new Signal();
147             OnNewGameStartedSignal = new Signal();
148
149             ServiceLocator.AddService(this);
150         }
File name: NetworkAdapter.cs Copy
167         private void OnFailToConnectToPhoton()
168         {
169             OnConnectionFailSignal.Dispatch("Connection failed doe to invalid AppId or some network issues");
170         }
File name: NetworkAdapter.cs Copy
172         private void OnConnectionFail(DisconnectCause cause)
173         {
174             OnConnectionFailSignal.Dispatch("Connection failed doe to " + cause);
175         }
File name: Connecting.cs Copy
28         protected override void Start()
29         {
30             base.Start();
31
32             NetworkService.OnBeginConnectingSignal.AddListener(Show);
33             NetworkService.OnConnectedToMasterSignal.AddListener(OnConnectedToMaster);
34             NetworkService.OnConnectionFailSignal.AddListener(OnConnectionFail);
35         }
File name: Connecting.cs Copy
37         protected override void OnDestroy()
38         {
39             base.OnDestroy();
40
41             NetworkService.OnBeginConnectingSignal.RemoveListener(Show);
42             NetworkService.OnConnectedToMasterSignal.RemoveListener(OnConnectedToMaster);
43             NetworkService.OnConnectionFailSignal.RemoveListener(OnConnectionFail);
44         }
File name: UIgame.cs Copy
59     public void ShowLives(int lives)
60     {
61         if (lives <= 0)
62         {
63             lifeBar.enabled = false;
64             FailScreen.SetActive(true);
65             return;
66         }
67         else
68             lifeBar.sprite = hearts[lives - 1];
69     }

Fails 86 lượt xem

Gõ tìm kiếm nhanh...