protected override void OnEnter(IState prevState, ChangeStateType type, object param1 = null) { if (type == ChangeStateType.Push) { this.gameObject.SetActive(true); } else { canvasGroup.blocksRaycasts = true; } }
protected override void OnLeave(IState prevState, ChangeStateType type, object param1 = null) { if (type == ChangeStateType.Pop) { this.gameObject.SetActive(false); } else { canvasGroup.blocksRaycasts = false; } }
protected override void OnEnter(IState prevState, ChangeStateType type, object param1 = null) { }
public override void deviceChangedLevel(Guid deviceId, ChangeStateType changeType, int oldLevel, int newLevel) { BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (s, a) => { var device = getDevice(deviceId); string updateString = deviceToString(device); if (!string.IsNullOrEmpty(updateString)) { //broadcastMessage("UPDATE~" + updateString + Environment.NewLine); broadcastMessage(updateString + Environment.NewLine); //broadcastMessage("ENDLIST" + Environment.NewLine); } string device_name = string.Empty; device_name = device.name; //broadcastMessage("MSG~" + "'" + device_name + "' " + deviceId + " changed to " + newLevel + Environment.NewLine); broadcastMessage(device_name + "~" + deviceId + "~" + newLevel + Environment.NewLine); }; bw.RunWorkerAsync(); }
protected abstract void OnLeave(IState prevState, ChangeStateType type, object param1 = null);