void AddSearchLight(MiniCopter copter)
        {
            SphereEntity sph = (SphereEntity)GameManager.server.CreateEntity(spherePrefab, copter.transform.position, new Quaternion(0, 0, 0, 0), true);

            DestroyMeshCollider(sph);
            DestroyGroundComp(sph);
            sph.Spawn();
            sph.SetParent(copter);
            sph.transform.localPosition = new Vector3(0, -100, 0);
            SearchLight searchLight = GameManager.server.CreateEntity(searchLightPrefab, sph.transform.position) as SearchLight;

            DestroyMeshCollider(searchLight);
            DestroyGroundComp(searchLight);
            searchLight.Spawn();
            searchLight.GetComponent <StorageContainer>().isLootable = false;
            searchLight.SetFlag(BaseEntity.Flags.Reserved5, true, false, true);
            searchLight.SetParent(sph);
            searchLight.transform.localPosition = new Vector3(0, 0, 0);
            searchLight.transform.localRotation = Quaternion.Euler(new Vector3(20, 0, 180));
            searchLight.transform.localRotation = Quaternion.Euler(new Vector3(20, 0, 0));
            searchLight.transform.localRotation = Quaternion.Euler(new Vector3(20, 0, 180));
            Puts(searchLight.eyePoint.transform.position.ToString());
            searchLight._maxHealth     = 99999999f;
            searchLight._health        = 99999999f;
            searchLight.pickup.enabled = false;
            searchLight.isLockable     = true;
            searchLight.SendNetworkUpdate();
            sph.transform.localScale += new Vector3(0.9f, 0, 0);
            sph.LerpRadiusTo(0.1f, 10f);
            timer.Once(3f, () => {
                sph.transform.localPosition = new Vector3(0, 0.24f, 1.8f);
            });
            sph.SendNetworkUpdateImmediate();
            //PrintComponents(searchLight);
        }
Esempio n. 2
0
 private void SetupSearchLight(SearchLight searchLight)
 {
     RemoveProblemComponents(searchLight);
     HideInputsAndOutputs(searchLight);
     searchLight.SetFlag(BaseEntity.Flags.Busy, true);
     searchLight.baseProtection = ImmortalProtection;
     searchLight.pickup.enabled = false;
 }
Esempio n. 3
0
            void Awake()
            {
                searchlight = GetComponent <SearchLight>();
                target      = new GameObject();
                degrees     = Instance.configData.dps1;

                PlayerControllerSpawn();
                searchlight.PlayerEnter(player);
            }
 void ToggleFLight(BaseEntity ent)
 {
     ent.SetFlag(BaseEntity.Flags.On, !ent.IsOn());
     if (ent is SearchLight)
     {
         SearchLight sl = ent as SearchLight;
         sl.secondsRemaining = 9999999999;
     }
     ent.SendNetworkUpdateImmediate();
 }
 void AddSearchlight(SearchLight light)
 {
     if (!configData.LightTypes[ConsumeTypes.Searchlights])
     {
         return;
     }
     if (light != null)
     {
         searchLights.Add(light);
     }
 }
Esempio n. 6
0
    void Start()
    {
        _rigid       = GetComponent <Rigidbody2D>();
        _movie       = WitchFairyBattleMovie.Instance;
        search_Light = transform.Find("SearchLight").GetComponent <SearchLight>();
        search_Light.gameObject.SetActive(false);
        side_Collider = transform.Find("SideCollision").GetComponent <ChildColliderTrigger>();

        player      = GameObject.FindWithTag("PlayerTag");
        main_Camera = GameObject.FindWithTag("MainCamera");

        //被弾の当たり判定は子供の方で行う
        Destroy(GetComponent <EnemyCollisionDetection>());
    }
Esempio n. 7
0
            public void ToggleLight(bool status)
            {
                if (config.Owner && !ins.UserHasToggled(entity.OwnerID, consumeType))
                {
                    status = false;
                }

                if (isSearchlight)
                {
                    SearchLight searchLight = entity as SearchLight;
                    if (searchLight != null)
                    {
                        if (status)
                        {
                            Item slot = searchLight.inventory.GetSlot(0);
                            if (slot == null)
                            {
                                ItemManager.Create(searchLight.fuelType).MoveToContainer(searchLight.inventory);
                            }
                        }
                        searchLight.SetFlag(BaseEntity.Flags.On, status);
                    }
                }
                else
                {
                    BaseOven baseOven = entity as BaseOven;
                    if (baseOven != null)
                    {
                        if (config.ConsumeFuel)
                        {
                            if (status)
                            {
                                baseOven.StartCooking();
                            }
                            else
                            {
                                baseOven.StopCooking();
                            }
                        }
                        else
                        {
                            if (baseOven.IsOn() != status)
                            {
                                baseOven.SetFlag(BaseEntity.Flags.On, status);
                            }
                        }
                    }
                }
                entity.SendNetworkUpdate();
            }
Esempio n. 8
0
        private SearchLight TryDeploySearchLight(Drone drone)
        {
            if (DeployLightWasBlocked(drone))
            {
                return(null);
            }

            // Spawn the search light below the map initially while the resize is performed.
            SphereEntity sphereEntity = GameManager.server.CreateEntity(SpherePrefab, SphereEntityInitialLocalPosition) as SphereEntity;

            if (sphereEntity == null)
            {
                return(null);
            }

            // Fix the issue where leaving the area and returning would not recreate the sphere and its children on clients.
            sphereEntity.globalBroadcast = false;

            sphereEntity.currentRadius = 0.1f;
            sphereEntity.lerpRadius    = 0.1f;

            sphereEntity.SetParent(drone);
            sphereEntity.Spawn();

            var         localRotation = Quaternion.Euler(_pluginConfig.SearchLight.DefaultAngle - 90 % 350, SearchLightYAxisRotation, 0);
            SearchLight searchLight   = GameManager.server.CreateEntity(SearchLightPrefab, SearchLightLocalPosition, localRotation) as SearchLight;

            if (searchLight == null)
            {
                return(null);
            }

            SetupSearchLight(searchLight);

            searchLight.SetParent(sphereEntity);
            searchLight.Spawn();
            Interface.CallHook("OnDroneSearchLightDeployed", drone, searchLight);

            timer.Once(3, () =>
            {
                if (sphereEntity != null)
                {
                    sphereEntity.transform.localPosition = SphereEntityLocalPosition;
                }
            });

            return(searchLight);
        }
Esempio n. 9
0
        protected override void PrivatePerformAction(bool prompt)
        {
            try
            {
                Overwatch.Log("Cleanup Concert");

                foreach (ShowVenue obj in Sims3.Gameplay.Queries.GetObjects <ShowVenue>())
                {
                    Overwatch.Log("Reset " + obj.ShowType);

                    foreach (ISearchLight light in obj.LotCurrent.GetObjects <ISearchLight>())
                    {
                        try
                        {
                            light.TurnOff();
                        }
                        catch
                        { }

                        SearchLight searchLight = light as SearchLight;
                        if (searchLight != null)
                        {
                            try
                            {
                                searchLight.mSMC.Dispose();
                            }
                            catch
                            { }

                            searchLight.mSMC = null;
                        }
                    }

                    obj.EndPlayerConcert();
                }

                if (prompt)
                {
                    Overwatch.AlarmNotify(Common.Localize("CleanupConcert:Complete"));
                }
            }
            catch (Exception e)
            {
                Common.Exception(Name, e);
            }
        }
Esempio n. 10
0
        public void Intialize()
        {
            //シーン終了フラグを初期化
            isEndFlag = false;
            //キャラクターマネージャーの実態生成
            characterManager = new CharacterManager();
            kaito            = new Kaito(this);
            kaito.Initialize();
            stage = new Stage(kaito);
            goal  = new Goal(kaito);
            characterManager.Add(kaito);

            //characterManager.Add(new SearchLight(this, new SearchLightAI(),kaito));
            light = new SearchLight(this, new SearchLightAI(), kaito);
            light.Initialize();
            //時間関連
            timerUI = new TimerUI(limitTimer);
            //スコア関連
            score = new Score();
            //制限時間
            limitTimer.Intialize();
            //かかった時間
            scoreTimer.Intialize();
        }
Esempio n. 11
0
 public void Setting(SearchLight manager)
 {
     this.manager = manager;
     _sprite      = GetComponent <SpriteRenderer>();
 }
Esempio n. 12
0
 static void CheckShowVenues()
 {
     try{
         foreach (ShowVenue showVenue in Sims3.Gameplay.Queries.GetObjects <ShowVenue>())
         {
             try{
                 if (showVenue.ShowInProgress ||
                     showVenue.ShowType != ShowVenue.ShowTypes.kNoShow)
                 {
                     if (!ShowDetected.ContainsKey(showVenue))
                     {
                         ShowDetected.Add(showVenue, new ShowDetectedData(SimClock.CurrentTicks));
                     }
                 }
             }catch (Exception exception) {
                 Alive.WriteLog(exception.Message + "\n\n" +
                                exception.StackTrace + "\n\n" +
                                exception.Source + "\n\n" +
                                "CheckShowVenues_foreach_check");
             }finally{
             }
         }
         List <KeyValuePair <ShowVenue, ShowDetectedData> > toRemove = new List <KeyValuePair <ShowVenue, ShowDetectedData> >();
         foreach (var showDetectedData in ShowDetected)
         {
             try{
                 if (showDetectedData.Key.HasBeenDestroyed)
                 {
                     toRemove.Add(showDetectedData);
                 }
                 else
                 if (!showDetectedData.Key.ShowInProgress &&
                     showDetectedData.Key.ShowType == ShowVenue.ShowTypes.kNoShow)
                 {
                     foreach (ISearchLight light in showDetectedData.Key.LotCurrent.GetObjects <ISearchLight>())
                     {
                         light.TurnOff();
                         SearchLight searchLight = light as SearchLight;
                         if (searchLight != null)
                         {
                             searchLight.mSMC?.Dispose();
                             searchLight.mSMC = null;
                         }
                     }
                     toRemove.Add(showDetectedData);
                 }
                 else
                 if (
                     SimClock.CurrentTicks - showDetectedData.Value.ShowStartTimeTicks > SimClock.kSimulatorTicksPerSimMinute * 300)    //  Reset
                 {
                     foreach (ISearchLight light in showDetectedData.Key.LotCurrent.GetObjects <ISearchLight>())
                     {
                         light.TurnOff();
                         SearchLight searchLight = light as SearchLight;
                         if (searchLight != null)
                         {
                             searchLight.mSMC?.Dispose();
                             searchLight.mSMC = null;
                         }
                     }
                     showDetectedData.Key.EndPlayerConcert();
                     toRemove.Add(showDetectedData);
                 }
             }catch (Exception exception) {
                 Alive.WriteLog(exception.Message + "\n\n" +
                                exception.StackTrace + "\n\n" +
                                exception.Source + "\n\n" +
                                "CheckShowVenues_foreach_end");
             }finally{
             }
         }
         for (int i = 0; i < toRemove.Count; i++)
         {
             ShowDetected.Remove(toRemove[i].Key);
         }
         toRemove.Clear();
     }catch (Exception exception) {
         Alive.WriteLog(exception.Message + "\n\n" +
                        exception.StackTrace + "\n\n" +
                        exception.Source + "\n\n" +
                        "CheckShowVenues");
     }finally{
     }
 }
Esempio n. 13
0
 private void Awake()
 {
     _drone       = GetComponent <Drone>();
     _searchLight = GetDroneSearchLight(_drone);
 }