public override ProcessResult ProcessMessage(int userid, string text) { if (text.ToLower() == "выкл") { if (!TurnedOff.Contains(userid)) { TurnedOff.Add(userid); CallUsersGridUpdate(new UsersGridUpdateEventArgs("TurnedOff", userid, "Off")); //vk.SendMessage(userid, "Бот отключен. Если хочешь чтоб бот снова отвечал пользователям, напиши ВКЛ"); return(ProcessResult.Processed); } } if (text.ToLower() == "вкл") { if (TurnedOff.Contains(userid)) { TurnedOff.Remove(userid); CallUsersGridUpdate(new UsersGridUpdateEventArgs("TurnedOff", userid, "On")); vk.SendMessage(userid, "Бот включён и готов тебе ответить :з"); return(ProcessResult.Processed); } } if (TurnedOff.Contains(userid)) { return(ProcessResult.Processed); } else { return(ProcessResult.Skipped); } }
public override void GetProperties() { GameObject propertiesContainer = GameObject.Find("PropertiesWindowContainer"); EditObjectProperties script = propertiesContainer.GetComponent<EditObjectProperties>(); script.AddString("ComponentNameLabel", _name, SetName); script.AddBoolean("TurnedOffPropertyLabel", TurnedOff.ToString(), SetTurnedOff); }
public virtual void TurnOff() { Rect.SetActive(false); TurnedOff?.Invoke(); if (Top.Peek() == this) { Top.Pop(); } }
public override void Off() // выключили холодильник { if (Status) { Status = false; if (TurnedOff != null) { TurnedOff.Invoke("Холодильник выключили"); } } }
public IEnumerator TempButton() { m_Activated = true; m_AlreadyInteracting = true; TurnedOn.Invoke(); yield return(new WaitForSeconds(m_TempButtonDuration)); m_Activated = false; m_AlreadyInteracting = false; TurnedOff.Invoke(); }
private IEnumerator OnWhileOn() { m_Activated = true; m_AlreadyInteracting = true; TurnedOn.Invoke(); yield return(null); yield return(null); Debug.Log("Off"); m_Activated = false; m_AlreadyInteracting = false; TurnedOff.Invoke(); m_OnWhileTriggered = null; }
public IEnumerator ActivationCooldown() { m_Activated = !m_Activated; m_AlreadyInteracting = true; if (m_Activated) { TurnedOn.Invoke(); } else { TurnedOff.Invoke(); } yield return(new WaitForSeconds(m_DelayBetweenActivations)); m_AlreadyInteracting = false; }
protected virtual void OnButtonOff() => TurnedOff?.Invoke(this, EventArgs.Empty);