public static List <Trigger> Select(bool dbconOpened, Trigger.Modes mode, int modeID) { openIfNeeded(dbconOpened); dbcmd.CommandText = "SELECT * FROM " + table + " WHERE mode = \"" + mode + "\" AND modeID = " + modeID; LogB.SQL(dbcmd.CommandText.ToString()); dbcmd.ExecuteNonQuery(); SqliteDataReader reader = dbcmd.ExecuteReader(); List <Trigger> l = new List <Trigger>(); while (reader.Read()) { Trigger trigger = new Trigger( Convert.ToInt32(reader[0]), //uniqueID (Trigger.Modes)Enum.Parse( typeof(Trigger.Modes), reader[1].ToString()), //mode Convert.ToInt32(reader[2]), //modeID Convert.ToInt32(reader[3]), //ms Util.IntToBool(Convert.ToInt32(reader[4])), //inOut reader[5].ToString(), //name reader[6].ToString(), //color reader[7].ToString() //comments ); l.Add(trigger); } reader.Close(); closeIfNeeded(dbconOpened); return(l); }
/* Camera _mainCamera; * Camera _activeCamera; * * /// <summary> * /// Sets the camera that the Conversation Flow should use. * /// </summary> * /// <param name="flow"></param> * void SetCamera(ConversationFlow flow, int index) * { * if (flow.CameraController.Enable) * { * if (index == -1 || index > flow.CameraController.CameraList.Count) * index = flow.CameraController.DefaultIndex; * * _activeCamera.enabled = false; * * Debug.Log("Camera index: " + index); * * if (index < 0) * _activeCamera = _mainCamera; * else * { * index = Mathf.Min(index, flow.CameraController.CameraList.Count); * _activeCamera = flow.CameraController.CameraList[index]; * } * _activeCamera.enabled = true; * } * } * * /// <summary> * /// Reset cameras to default: all turn off, except main camera. * /// </summary> * void ResetCamera(ConversationFlow flow) * { * if (_mainCamera != null) * { * _mainCamera.enabled = true; * _activeCamera = _mainCamera; * } * * if (flow.UseCustomCameras) * { * for (int cnt = 0; cnt < flow.ConversationCameras.Count; cnt++) * flow.ConversationCameras[cnt].enabled = false; * } * }*/ #endregion /// <summary> /// Starts the dialogue with the given trigger mode, if it's allowed. /// </summary> /// <param name="dialogue"></param> /// <param name="mode"></param> public void StartDialogue(DialogueFlow dialogue, Trigger.Modes mode, Transform player = null) { if (dialogue.CheckTrigger(mode)) { Player = player; dialogue.Player = player; CallEvent(dialogue.EVENT_NAME); if (dialogue == Conversation && IsAmbientDialogueActive) { StopDialogue(AmbientDialogue); } } }
public bool CheckTrigger(Trigger.Modes mode) { return(Enabled && Trigger.Mode == mode); }