コード例 #1
0
 public CoreUpdate(WorldManager manager)
 {
     _watch     = new Stopwatch();
     _worldTime = new WorldTime();
     ResetEvent = new AutoResetEvent(true);
     _manager   = manager;
 }
コード例 #2
0
    public void Update()
    {
        TimeManager tm   = TimeManager.Instance;
        WorldTime   time = tm.WorldTime;

        textComponent.text = time.ToString();
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     WorldTimeObj = GameObject.Find("Master");
     worldtime    = WorldTimeObj.GetComponent <WorldTime>();
     DefaltPos    = transform.position;
     DefaltPos.x  = -MaxMoveDistance;
 }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        int    timeLeft   = Mathf.Max(0, chaseEndTime - WorldTime.worldTimeInHours);
        string timeString = WorldTime.ConvertToTimeString(timeLeft);

        textUI.text = chaserName + ": " + timeString;
    }
コード例 #5
0
        public void Reset()
        {
            this.Seed                = (int)DateTime.UtcNow.TimeOfDay.Ticks;
            m_CurrentMap             = null;
            m_Scoring                = new Scoring();
            m_World                  = null;
            m_WorldTime              = new WorldTime();
            this.LastTurnPlayerActed = 0;

            m_Event_Raids = new int[(int)RaidType._COUNT, RogueGame.Options.CitySize, RogueGame.Options.CitySize];
            for (int i = (int)RaidType._FIRST; i < (int)RaidType._COUNT; i++)
            {
                for (int x = 0; x < RogueGame.Options.CitySize; x++)
                {
                    for (int y = 0; y < RogueGame.Options.CitySize; y++)
                    {
                        m_Event_Raids[i, x, y] = -1;
                    }
                }
            }

            ////////////////////////////
            // Reset special properties.
            ////////////////////////////
            this.CHARUndergroundFacility_Activated           = false;
            this.PlayerKnows_CHARUndergroundFacilityLocation = false;
            this.PlayerKnows_TheSewersThingLocation          = false;
            this.ScriptStage_PoliceStationPrisonner          = ScriptStage.STAGE_0;
            this.UniqueActors = new UniqueActors();
            this.UniqueItems  = new UniqueItems();
            this.UniqueMaps   = new UniqueMaps();
        }
コード例 #6
0
ファイル: HUD.cs プロジェクト: nasa03/farm-with-friends
    void Awake()
    {
        GameObject obj = GameObject.FindGameObjectWithTag("GameManager");

        gametime    = (WorldTime)obj.GetComponent <WorldTime> ();
        gameManager = (GameManager)obj.GetComponent <GameManager> ();
    }
コード例 #7
0
        public override void Select(MainForm frm)
        {
            base.Select(frm);

            foreach (var tabpage in frm.MainTabEventCollectionTypes.TabPages.Cast <TabPage>().Where(tabpage => tabpage != frm.tabEventCollectionPurge))
            {
                frm.MainTabEventCollectionTypes.TabPages.Remove(tabpage);
            }
            if (!frm.MainTabEventCollectionTypes.TabPages.Contains(frm.tabEventCollectionPurge))
            {
                frm.MainTabEventCollectionTypes.TabPages.Add(frm.tabEventCollectionPurge);
            }

            if (StartTime != null || EndTime != null)
            {
                frm.lblPurgeTime.Text     = $"{StartTime} - {EndTime}";
                frm.lblPurgeDuration.Text = WorldTime.Duration(EndTime, StartTime);
            }
            else
            {
                frm.lblPurgeTime.Text     = "";
                frm.lblPurgeDuration.Text = "";
            }
            frm.lblPurgeOrdinal.Text   = Ordinal.ToString();
            frm.lblPurgeSite.Data      = Site;
            frm.lblPurgeAdjective.Text = Adjective;

            frm.lstPurgeEvents.Items.Clear();
            if (Event != null)
            {
                frm.lstPurgeEvents.Items.AddRange(Event.ToArray());
            }

            SelectTab(frm);
        }
コード例 #8
0
        private void CreateRendererStates()
        {
            _logRendererState = new LogRendererState
            {
                Visible = _logConfiguration.Visible,
                MaximumVisibleLogLines = _logConfiguration.MaximumVisibleLogLines,
                MinimumWindowWidth     = _logConfiguration.MinimumWindowWidth,
                LogEntryLifetime       = _logConfiguration.LogEntryLifetime,
                ShowTimestamps         = _logConfiguration.ShowTimestamps,
                ShowRaisingEvents      = _logConfiguration.ShowRaisingEvents
            };
            _worldTimeRendererState = new WorldTimeRendererState
            {
                Visible = _worldTimeConfiguration.Visible
            };

            var worldTime     = new WorldTime(_worldTimeRendererState);
            var worldObserver = new WorldObserver(worldTime, _logRendererState);

            _worldInstance = new WorldInstance(_world, _player, worldTime, worldObserver, _multimediaPlayer);

            _boardRendererState = new BoardRendererState(_worldInstance.Player);
            _fpsRendererState   = new FpsRendererState
            {
                Visible = _fpsConfiguration.Visible
            };
        }
コード例 #9
0
    /*
     * Checks all input sources for a player pressing "Start" and binds them when they join.
     */
    void PollForNewPlayer()
    {
        int nextPlayerIndex = NumPlayers;

        foreach (InputDevice device in InputDevices.GetAllInputDevices())
        {
            if (!boundDevices.ContainsKey(device) || (IsCheatingEnabled && cheats.BIND_MANY_TO_ONE_DEVICE))
            {
                if (RBInput.GetButtonDownForPlayer(InputStrings.PAUSE, nextPlayerIndex, device))
                {
                    BindNextPlayer(device);

                    // Deactivate the splash screen once a player is bound. This is NOT ideal, but
                    // neither is putting a splash screen into every scene. It should be it's own scene.
                    WorldTime worldTime  = (WorldTime)GetComponent <WorldTime> ();
                    Transform startPoint = worldTime.startPointP2;
                    if (NumPlayers == 1)
                    {
                        HideSplashScreen();
                        worldTime.Reset();
                    }
                    else
                    {
                        players [nextPlayerIndex].GetComponent <PlayerController> ().SnapToPoint(startPoint);
                    }
                }
            }
        }
    }
コード例 #10
0
 public GameTimer(WorldTime DFWorldTime)
 {
     unknownInformation = new List <string>();
     running            = false;
     complete           = false;
     worldTime          = DFWorldTime;
 }
コード例 #11
0
    public void StartGame(int difficulty, GameEndCallback callback)
    {
        FocusMe();
        this.callback = callback;
        isGameRunning = true;
        spawnedNotes  = new List <Note>(4);
        errorCount    = 0;
        noteCount     = 0;
        spawnNotes    = true;
        root.SetActive(true);
        WorldTime.Pause();

        if (difficulty == 1)
        {
            currentGameDiff = easy;
        }
        else if (difficulty == 2)
        {
            currentGameDiff = medium;
        }
        else
        {
            currentGameDiff = hard;
        }

        SpawnNote(currentGameDiff);
        timeTillNextNote = currentGameDiff.GetSpawnIntervall();
        UpdateErrorCountText();
    }
コード例 #12
0
        public static void SetTVTLua(Lua lua)
        {
            lua.DoFile("res\\ai\\SLF.lua");
            lua.DoFile("res\\ai\\AIEngine.lua");
            lua.DoFile("res\\ai\\BudgetManager.lua");
            lua.DoFile("res\\ai\\TestAIPlayer.lua");

            var player    = new Player();
            var tvt       = new TVT();
            var worldTime = new WorldTime();

            lua.NewTable("MY");
            lua.RegisterFunction("MY.GetMoney", player, typeof(Player).GetMethod("GetMoney"));

            lua.NewTable("TVT");
            lua.RegisterFunction("TVT.addToLog", tvt, typeof(TVT).GetMethod("AddToLog"));
            lua.RegisterFunction("TVT.GetMillisecs", tvt, typeof(TVT).GetMethod("GetMillisecs"));

            lua.NewTable("WorldTime");
            lua.RegisterFunction("WorldTime.GetDaysRun", worldTime, typeof(WorldTime).GetMethod("GetDaysRun"));
            lua.RegisterFunction("WorldTime.GetTimeGoneAsMinute", worldTime, typeof(WorldTime).GetMethod("GetTimeGoneAsMinute"));

            lua.DoString(@"globalPlayer = TestAIPlayer()
					globalPlayer:initialize()
					_G['globalPlayer'] = globalPlayer"                    );
        }
コード例 #13
0
ファイル: WorldManager.cs プロジェクト: connorc1/ProjectAI
    /*Purpose: To deserialize a copy of the datetime from a file if that file exists
     */
    private void loadClockData()
    {
        if (File.Exists(Application.persistentDataPath + "/WorldData.dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/WorldData.dat", FileMode.Open);

            string fromFile = "";   //Holds the value of the saved time, once obtained from try catch statement
            try
            {
                fromFile = bf.Deserialize(file) as string;
            }
            catch (EndOfStreamException e)
            {
                Debug.Log("Failed Load");
                return;
            }
            file.Close();

            //Convert the string form of time to a datetime
            DateTime toLoad = DateTime.Parse(fromFile, null, DateTimeStyles.RoundtripKind);

            //set the world time in the scene
            WorldTime time = FindObjectOfType(typeof(WorldTime)) as WorldTime;
            time.WORLDTIME = toLoad;
        }
    }
コード例 #14
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         WorldTime worldtime = (WorldTime)GameObject.FindGameObjectWithTag("GameManager").GetComponent <WorldTime> ();
         worldtime.GoToNextDay();
     }
 }
コード例 #15
0
        private void OnDayNightUpdated(bool isDaytime)
        {
            WorldTime worldTime = isDaytime ? WorldTime.Day : WorldTime.Night;

            UnturnedDayNightUpdatedEvent @event = new UnturnedDayNightUpdatedEvent(worldTime, LightingManager.isFullMoon);

            Emit(@event);
        }
コード例 #16
0
 void Start()
 {
     TargetObj    = GameObject.Find("Player");
     WorldTimeObj = GameObject.Find("Master");
     worldtime    = WorldTimeObj.GetComponent <WorldTime>();
     vec          = (TargetObj.transform.position - transform.position).normalized;
     Destroy(gameObject, 10);
 }
コード例 #17
0
ファイル: Database.cs プロジェクト: tier6tank/DFWV
 internal static object DBExport(this WorldTime time, bool year)
 {
     if (time == null)
     {
         return(DBNull.Value);
     }
     return(year ? time.Year : time.TotalSeconds);
 }
コード例 #18
0
 public static void ChangeTime(WorldTime newTime)
 {
     if (_instance == null)
     {
         return;
     }
     _instance.CurrentTime = newTime;
     _instance.OnTimeChange.Invoke();
 }
コード例 #19
0
ファイル: Story3TestCase.cs プロジェクト: chavp/AgileSamurai
        public void Story3Case()
        {
            //http://www.bangkokpost.com/learning/learning-together/278662/k-pop-groupie-has-his-ticket
            //“The Korean pop group Girls’ Generation poses on the red carpet at the MNET Asian Music Awards ceremony in Singapore last November.”

            WorldTime.LastNovember(new Korean().GetPopulationByName <GirlsGeneration>("Girls’ Generation").Poses().On(new Carpet {
                Color = "Red"
            }).At(new MNETAsianMusicAwards()).In(new Singapore()));
        }
コード例 #20
0
ファイル: WorldTime.cs プロジェクト: vrglab/ProjectAurora
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         throw new TwoWorldTimeException();
     }
 }
コード例 #21
0
        public override void Select(MainForm frm)
        {
            base.Select(frm);

            foreach (var tabpage in frm.MainTabEventCollectionTypes.TabPages.Cast <TabPage>().Where(tabpage => tabpage != frm.tabEventCollectionAbduction))
            {
                frm.MainTabEventCollectionTypes.TabPages.Remove(tabpage);
            }
            if (!frm.MainTabEventCollectionTypes.TabPages.Contains(frm.tabEventCollectionAbduction))
            {
                frm.MainTabEventCollectionTypes.TabPages.Add(frm.tabEventCollectionAbduction);
            }

            frm.lblAbductionRegion.Data   = Subregion;
            frm.lblAbductionSite.Data     = Site;
            frm.lblAbductionCoords.Data   = new Coordinate(Coords);
            frm.lblAbductionAttacker.Data = AttackingEn;
            frm.lblAbductionDefender.Data = DefendingEn;
            frm.lblAbductionParent.Data   = ParentEventCol;
            if (StartTime != null || EndTime != null)
            {
                frm.lblAbductionTime.Text     = string.Format("{0} - {1}", StartTime, EndTime);
                frm.lblAbductionDuration.Text = WorldTime.Duration(EndTime, StartTime);
            }
            else
            {
                frm.lblAbductionTime.Text     = "";
                frm.lblAbductionDuration.Text = "";
            }
            frm.lblAbductionOrdinal.Text = Ordinal.ToString();

            frm.lstAbductionEvents.Items.Clear();
            if (Event != null)
            {
                frm.lstAbductionEvents.Items.AddRange(Event.ToArray());
            }

            frm.grpAbductionEvents.Visible = frm.lstAbductionEvents.Items.Count > 0;

            if (frm.lstAbductionEvents.Items.Count > 0)
            {
                frm.lstAbductionEvents.SelectedIndex = 0;
            }

            frm.lstAbductionEventCols.Items.Clear();
            if (EventCol != null)
            {
                frm.lstAbductionEventCols.Items.AddRange(EventCol.ToArray());
            }

            frm.grpAbductionEventCols.Visible = frm.lstAbductionEventCols.Items.Count > 0;

            SelectTab(frm);
        }
コード例 #22
0
        internal void UpdateTime()
        {
            if (!isRunning)
            {
                return;
            }

            this.time = new WorldTime((int)(GetPreciseTicks() / TimeSpan.TicksPerSecond));

            pUpdateTime();
        }
コード例 #23
0
    void Start()
    {
        worldTime = FindObjectOfType <WorldTime>();
        worldTime.OnTimeChangedEvent += SetTimeText;

        UIEventHandler.OnPlayerHealthChanged  += UpdateHealthBar;
        UIEventHandler.OnPlayerMagickaChanged += UpdateMagickaBar;
        UIEventHandler.OnPlayerStaminaChanged += UpdateStaminaBar;
        UIEventHandler.OnPlayerXPChanged      += UpdateExp;
        UIEventHandler.OnPlayerSkillsChanged  += UpdateSkills;
    }
コード例 #24
0
ファイル: ItemFood.cs プロジェクト: Tomash667/Rogue-Survivor
        /// <summary>
        /// Perishable food.
        /// </summary>
        /// <param name="model"></param>
        /// <param name="bestBefore"></param>
        public ItemFood(ItemModel model, int bestBefore)
            : base(model)
        {
            if (!(model is ItemFoodModel))
            {
                throw new ArgumentException("model is not a FoodModel");
            }

            this.Nutrition    = (model as ItemFoodModel).Nutrition;
            this.BestBefore   = new WorldTime(bestBefore);
            this.IsPerishable = true;
        }
コード例 #25
0
        public override void Select(MainForm frm)
        {
            base.Select(frm);

            foreach (var tabpage in frm.MainTabEventCollectionTypes.TabPages.Cast <TabPage>().Where(tabpage => tabpage != frm.tabEventCollectionTheft))
            {
                frm.MainTabEventCollectionTypes.TabPages.Remove(tabpage);
            }
            if (!frm.MainTabEventCollectionTypes.TabPages.Contains(frm.tabEventCollectionTheft))
            {
                frm.MainTabEventCollectionTypes.TabPages.Add(frm.tabEventCollectionTheft);
            }

            frm.lblTheftSite.Data     = Site;
            frm.lblTheftCoords.Data   = Site != null ? new Coordinate(Site.Coords) : null;
            frm.lblTheftAttacker.Data = AttackingEn;
            frm.lblTheftDefender.Data = DefendingEn;
            frm.lblTheftWar.Data      = WarEventCol;
            if (StartTime != null || EndTime != null)
            {
                frm.lblTheftTime.Text     = $"{StartTime} - {EndTime}";
                frm.lblTheftDuration.Text = WorldTime.Duration(EndTime, StartTime);
            }
            else
            {
                frm.lblTheftTime.Text     = "";
                frm.lblTheftDuration.Text = "";
            }
            frm.lblTheftOrdinal.Text = Ordinal.ToString();

            frm.lstTheftEvents.Items.Clear();
            if (Event != null)
            {
                frm.lstTheftEvents.Items.AddRange(Event.ToArray());
            }

            frm.grpTheftEvents.Visible = frm.lstTheftEvents.Items.Count > 0;

            if (frm.lstTheftEvents.Items.Count > 0)
            {
                frm.lstTheftEvents.SelectedIndex = 0;
            }

            frm.lstTheftEventCols.Items.Clear();
            if (EventCol != null)
            {
                frm.lstTheftEventCols.Items.AddRange(EventCol.ToArray());
            }

            frm.grpTheftEventCols.Visible = frm.lstTheftEventCols.Items.Count > 0;

            SelectTab(frm);
        }
コード例 #26
0
 public override void Update(GameTime gameTime)
 {
     WorldTime.Update(GameTime.DeltaTime);
     CheckDeads();
     foreach (Entity item in Entities)
     {
         item.Update(GameTime.DeltaTime);
     }
     if (WorldTime.FinishedDay)
     {
         NewDay();
     }
 }
コード例 #27
0
        private RoomBackground GetBackground()
        {
            if (conditionalBackgrounds.Count == 0)
            {
                // There's just one background: The default one. Return it.
                return(defaultBackground);
            }

            // Try to find the time-appropriate background
            WorldTime currentTime = World.Instance.CurrentTime;

            if (conditionalBackgrounds.ContainsKey(currentTime))
            {
                return(conditionalBackgrounds[currentTime]);
            }

            // If it wasn't found, look for similar ones (dawn is kinda like morning and night is kinda like dark!)
            switch (currentTime)
            {
            case WorldTime.Dawn:
                if (conditionalBackgrounds.ContainsKey(WorldTime.Morning))
                {
                    return(conditionalBackgrounds[WorldTime.Morning]);
                }
                break;

            case WorldTime.Morning:
                if (conditionalBackgrounds.ContainsKey(WorldTime.Dawn))
                {
                    return(conditionalBackgrounds[WorldTime.Dawn]);
                }
                break;

            case WorldTime.Night:
                if (conditionalBackgrounds.ContainsKey(WorldTime.Dark))
                {
                    return(conditionalBackgrounds[WorldTime.Dark]);
                }
                break;

            case WorldTime.Dark:
                if (conditionalBackgrounds.ContainsKey(WorldTime.Night))
                {
                    return(conditionalBackgrounds[WorldTime.Night]);
                }
                break;
            }

            // No appropriate background found? Just return the default one
            return(defaultBackground);
        }
コード例 #28
0
        public static void SetTime(object sender, string cmd, string[] param,
                                   out Dictionary <string, object> returnVal)
        {
            StringBuilder msgSB = new StringBuilder();

            WorldTime time = WorldTime.Zero;
            float     rate = 0f;
            bool      foundTime = false, foundRate = false;

            for (int i = 0; i < param.Length; i++)
            {
                if ((!foundRate) && (float.TryParse(param[i], out rate)))
                {
                    foundRate = true;
                }
                if ((!foundTime) && (WorldTime.TryParseDayHourMin(param[i], out time)))
                {
                    foundTime = true;
                }
                if (foundTime && foundRate)
                {
                    break;
                }
            }

            if (!(foundTime || foundRate))
            {
                msgSB.Append("No valid WorldTime or rate provided!");
            }
            else
            {
                if (!foundTime)
                {
                    time = WorldInst.List[0].Clock.Time;
                }
                if (!foundRate)
                {
                    rate = WorldInst.List[0].Clock.Rate;
                }
                WorldInst.List[0].Clock.SetTime(time, rate);
                msgSB.Append("Changed WorldTime to: ");
                msgSB.AppendFormat("( time: {0}, rate: {1} )", time, rate);
            }

            returnVal = new Dictionary <string, object>
            {
                { "type", WSProtocolType.chatData },
                { "sender", "SERVER" },
                { "rawText", msgSB.ToString() },
            };
        }
コード例 #29
0
        public override void Select(MainForm frm)
        {
            base.Select(frm);

            foreach (var tabpage in frm.MainTabEventCollectionTypes.TabPages.Cast <TabPage>().Where(tabpage => tabpage != frm.tabEventCollectionInsurrection))
            {
                frm.MainTabEventCollectionTypes.TabPages.Remove(tabpage);
            }
            if (!frm.MainTabEventCollectionTypes.TabPages.Contains(frm.tabEventCollectionInsurrection))
            {
                frm.MainTabEventCollectionTypes.TabPages.Add(frm.tabEventCollectionInsurrection);
            }


            frm.lblInsurrectionSite.Data   = Site;
            frm.lblInsurrectionParent.Data = ParentEventCol;

            frm.lblInsurrectionCoords.Data = new Coordinate(Site != null ? Site.Location : Point.Empty);

            if (StartTime != null || EndTime != null)
            {
                frm.lblInsurrectionTime.Text     = string.Format("{0} - {1}", StartTime, EndTime);
                frm.lblInsurrectionDuration.Text = WorldTime.Duration(EndTime, StartTime);
            }
            else
            {
                frm.lblInsurrectionTime.Text     = "";
                frm.lblInsurrectionDuration.Text = "";
            }
            frm.lblInsurrectionTargetEnt.Data = TargetEnt;

            frm.lblInsurrectionOutcome.Text = Outcome;

            frm.lblInsurrectionOrdinal.Text = Ordinal.ToString();

            frm.lstInsurrectionEvents.Items.Clear();
            if (Event != null)
            {
                frm.lstInsurrectionEvents.Items.AddRange(Event.ToArray());
            }

            frm.grpInsurrectionEvents.Visible = frm.lstInsurrectionEvents.Items.Count > 0;

            if (frm.lstInsurrectionEvents.Items.Count > 0)
            {
                frm.lstInsurrectionEvents.SelectedIndex = 0;
            }

            SelectTab(frm);
        }
コード例 #30
0
ファイル: Chunk.cs プロジェクト: Devwarlt/loe-core
 public void Update(WorldTime time)
 {
     if (time.TickCount % 5 == 0)
     {
         foreach (var i in Entities.ToArray())
         {
             if (Manager.Core.Map.Players.FirstOrDefault().Value != null)
             {
                 var player = Manager.Core.Map.Players.FirstOrDefault();
                 i.Move(player.Value.X, player.Value.Y);
             }
         }
     }
 }
コード例 #31
0
    void DayTimeChanged( WorldTime.DayTimeTypes timeType )
    {
        bool activateSI = false;
        foreach( WorldTime.DayTimeTypes type in ActivateOnTimes )
            if( type == timeType )
            {
                activateSI = true;
                break;
            }

        if( activateSI )
        {
            strobeInterpolator = GetComponent<StrobeLightInterpolator>();

            if( strobeInterpolator )
            {
                strobeInterpolator.Restart();
            }
        }
    }
コード例 #32
0
ファイル: PlayState.cs プロジェクト: chrisapril/dwarfcorp
 /// <summary>
 /// Creates a new play state
 /// </summary>
 /// <param name="game">The program currently running</param>
 /// <param name="stateManager">The game state manager this state will belong to</param>
 public PlayState(DwarfGame game, GameStateManager stateManager)
     : base(game, "PlayState", stateManager)
 {
     ShouldReset = true;
     Paused = false;
     Content = Game.Content;
     GraphicsDevice = Game.GraphicsDevice;
     Seed = Random.Next();
     RenderUnderneath = true;
     WorldOrigin = new Vector2(WorldWidth / 2, WorldHeight / 2);
     PreSimulateTimer = new Timer(3, false);
     Time = new WorldTime();
 }
コード例 #33
0
    void OnDayTimeChanged( WorldTime.DayTimeTypes type )
    {
        DayTimeType = WorldTime.Instance.CurrentTimeType;

        if( DebugPrintTransition )
            Console.Instance.addGameChatMessage( type.ToString() );

        // Tests from largest to least times
        // doing reverse order in this way is slightly faster
        switch( type )
        {
        case WorldTime.DayTimeTypes.Midnight:
            FromSetting = Midnight;
            ToSetting = Dawn;
            break;

        case WorldTime.DayTimeTypes.Dawn:
            FromSetting = Dawn;
            ToSetting = Sunrise;
            break;

        case WorldTime.DayTimeTypes.Sunrise:
            FromSetting = Sunrise;
            ToSetting = Noon;
            break;

        case WorldTime.DayTimeTypes.Noon:
            FromSetting = Noon;
            ToSetting = Sunset;
            break;

        case WorldTime.DayTimeTypes.Sunset:
            FromSetting = Sunset;
            ToSetting = Twilight;
            break;

        case WorldTime.DayTimeTypes.Twilight:

            if( DayPercent >= WorldTime.Instance.TwilightTime )
            {
                FromSetting = Twilight;
                ToSetting = MidnightWrapped;
            }
            else
            {
                FromSetting = TwilightWrapped;
                ToSetting = Midnight;
            }

            break;
        }
    }
コード例 #34
0
ファイル: Moon.cs プロジェクト: louismclean/I-Beg-To-Differ-2
 // Use this for initialization
 void Start()
 {
     worldTime = GameObject.Find("WorldTime").GetComponent<WorldTime>();
 }
コード例 #35
0
 void Start()
 {
     timer = GameObject.FindGameObjectWithTag ("WorldTime").GetComponent<WorldTime>();
     targetCol = sunnyCol_day;
     rainParticleSystem.SetActive(false);
     snowParticleSystem.SetActive(false);
 }
コード例 #36
0
ファイル: HUD.cs プロジェクト: lannes/farm-with-friends
 void Awake ()
 {
     GameObject obj = GameObject.FindGameObjectWithTag ("GameManager");
     gametime = (WorldTime)obj.GetComponent<WorldTime> ();
     gameManager = (GameManager)obj.GetComponent<GameManager> ();
 }