public void SetCamerasPlugin(ICameraPlugin camplugin) { foreach (var camera in _registeredCameras) { camera.CameraPlugin = camplugin; } }
/// <summary> /// Creates an <see cref="ICameraPlugin"/> for the specified camera. /// </summary> /// <param name="camera">The camera</param> /// <returns>The ICameraPlugin</returns> /// <exception cref="ArgumentNullException"><paramref name="camera"/> is null.</exception> /// <exception cref="InvalidPluginException">The camera does not have a plugin assigned.</exception> /// <exception cref="InvalidPluginException">The plugin cannot be found.</exception> public static ICameraPlugin Create(CameraRow camera) { if (camera == null) { throw new ArgumentNullException(nameof(camera)); } if (camera.PluginId == PluginTable.Defs.Values.NullPluginId) { throw new InvalidPluginException($"[{camera.Name}] does not have an associated plugin"); } ICameraPluginCreator creator = CompositionManager.Instance.GetCameraPluginCreator(camera.PluginGuid); if (creator == null) { throw new InvalidPluginException($"The plugin configured for [{camera.Name}] [{camera.PluginName}, Id: {camera.PluginGuid}] cannot be found"); } ICameraPlugin plugin = creator.Create(new ConnectionParameters(camera.IpAddress, camera.Port, camera.UserId, camera.Password)); if (plugin is ICameraMotion motion) { motion.SetMotionSpeedAsync((int)camera.MotionSpeed); } return(plugin); }
/// <summary> /// Awake this instance. /// </summary> protected override void Awake() { base.Awake(); m_WorldCamera = GameEngine.GetSingleton().QueryPlugin<ICameraPlugin>(); if (!m_WorldCamera) throw new System.NullReferenceException(); }
/// <summary> /// Awake this instance. /// </summary> void Awake() { m_Joystick = GameEngine.GetSingleton().LoadPlugin<IJoystickPlugin>(); if (!m_Joystick) throw new System.NullReferenceException(); IJoystickShape joystickShape = m_Joystick.GetJoystickShape(); if (!joystickShape) { m_Joystick.SetJoysticyShape( UISystem.GetSingleton().LoadWidget<IJoystickShape>(ResourceDef.UI_JOYSTICK), new Vector3(88, 88, 0) ); } // load game main camera m_MainCamera = GameEngine.GetSingleton().LoadPlugin<ICameraPlugin>(); if (!m_MainCamera) throw new System.NullReferenceException(); m_PlayerManager = GameEngine.GetSingleton().LoadPlugin<PlayerManager>(); if (!m_PlayerManager) throw new System.NullReferenceException(); }
/// <summary> /// Initializes a new instance of the <see cref="CameraBaseAIState"/> class. /// </summary> /// <param name="camera">Camera.</param> public CameraBaseAIState(int nID, ICameraPlugin owner) : base(nID) { m_Owner = owner; }
/// <summary> /// Initializes a new instance of the <see cref="CameraNormal"/> class. /// </summary> /// <param name="nID">N I.</param> /// <param name="camera">Camera.</param> public CameraNormal(ICameraPlugin camera) : base(CameraStateIDType.NORMAL, camera) { }