示例#1
0
    private void Update()
    {
        if (_trawnInput.GetButtonDown(TrawnButton.Blue, _info.player))
        {
            _info.score++;
            _scoredEvent.Fire(_info.player);
        }

        var input = _trawnInput.GetStickInput(_info.player);

        transform.position += (Vector3)input * Time.deltaTime * 2f;
    }
示例#2
0
        public void Update()
        {
            Current.Number++;

            //- Battles
            Log.Write("Checking Battles..");
            foreach (Tile tile in Tiles.Get())
            {
                tile.Update();
            }

            //- Processes
            BuildProcess[] now_finished = EveryProcess.FindEveryUnefficient(Current.Number);
            if (now_finished.Length != 0)
            {
                Log.Write("Dealing with Finished Processes..");
                foreach (BuildProcess process in now_finished)
                {
                    process.Done();
                }
            }
            EveryProcess = EveryProcess.RemoveEveryUnefficient(Current.Number);

            //- Events
            foreach (Event event_type in EventTypes)
            {
                if (event_type is PlayerEvent player_event)
                {
                    foreach (Citizen person in Citizens.Get())
                    {
                        if (person is Player player)
                        {
                            PlayerEvent local = Engine.CreateClass <PlayerEvent>(player_event.GetType());
                            local.Init(player);
                            if (local.Condition())
                            {
                                local.Fire();
                                Log.Write("Fire");
                            }
                        }
                    }
                }
            }

            Unit.HasMoved.Clear();
            Engine.Map.ChangeMapMode(Engine.Map.CurrentMapMode);
            Engine.UpdateEverySubWindow();
        }