public void GatherStaticCameras()
 {
     if (Rust.Application.isLoadingSave)
     {
         Invoke(GatherStaticCameras, 1f);
     }
     else
     {
         if (!isStatic || !(autoGatherRadius > 0f))
         {
             return;
         }
         List <BaseEntity> obj = Facepunch.Pool.GetList <BaseEntity>();
         Vis.Entities(base.transform.position, autoGatherRadius, obj, 256, QueryTriggerInteraction.Ignore);
         foreach (BaseEntity item in obj)
         {
             IRemoteControllable component = item.GetComponent <IRemoteControllable>();
             if (component != null)
             {
                 CCTV_RC component2 = item.GetComponent <CCTV_RC>();
                 if ((!component2 || component2.IsStatic()) && !controlBookmarks.ContainsKey(component.GetIdentifier()))
                 {
                     ForceAddBookmark(component.GetIdentifier());
                 }
             }
         }
         Facepunch.Pool.FreeList(ref obj);
     }
 }
Exemple #2
0
        private void OnEntityBuilt(Planner plan, GameObject go)
        {
            CCTV_RC cctvRc = go.ToBaseEntity() as CCTV_RC;

            if (cctvRc == null || cctvRc.IsStatic())
            {
                return;
            }

            cctvRc.hasPTZ = true;
        }
Exemple #3
0
        private void CheckCCTV()
        {
            foreach (BaseNetworkable entity in BaseNetworkable.serverEntities)
            {
                CCTV_RC cctv = entity as CCTV_RC;

                if (cctv == null || cctv.IsStatic())
                {
                    continue;
                }

                cctv.hasPTZ = true;
            }
        }
Exemple #4
0
        private void OnBookmarkControl(ComputerStation computerStation, BasePlayer player, string bookmarkName, IRemoteControllable entity)
        {
            UI.RemoveUI(player);

            CCTV_RC cctvRc = entity as CCTV_RC;

            if (cctvRc == null || cctvRc.IsStatic())
            {
                return;
            }

            if (!HasPermission(player))
            {
                return;
            }

            UI.CreateUI(player, Lang("Description", player.UserIDString));
        }
Exemple #5
0
            private void FixedUpdate()
            {
                CCTV_RC cctvRc = GetControlledCctv(_computerStation);

                if (cctvRc == null || cctvRc.IsStatic())
                {
                    return;
                }

                float y = _player.serverInput.IsDown(BUTTON.FORWARD) ? 1f : (_player.serverInput.IsDown(BUTTON.BACKWARD) ? -1f : 0f);
                float x = _player.serverInput.IsDown(BUTTON.LEFT) ? -1f : (_player.serverInput.IsDown(BUTTON.RIGHT) ? 1f : 0f);

                InputState inputState = new InputState();

                inputState.current.mouseDelta.y = y * _plugin._config.RotateSpeed;
                inputState.current.mouseDelta.x = x * _plugin._config.RotateSpeed;

                cctvRc.UserInput(inputState, _player);
            }
Exemple #6
0
 private void OnBookmarkControlEnd(ComputerStation station, BasePlayer player, CCTV_RC cctvRc)
 {
     UI.RemoveUI(player);
 }