本文整理汇总了C#中GameSettings类的典型用法代码示例。如果您正苦于以下问题:C# GameSettings类的具体用法?C# GameSettings怎么用?C# GameSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameSettings类属于命名空间,在下文中一共展示了GameSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SettingsWindow
public SettingsWindow(GameSettings settings)
{
this.settings = settings;
KeyDown += SettingsWindow_KeyDown;
InitializeComponent();
//IList<Level> levels = GetLevels();
}
示例2: Start
void Start()
{
gm = GameObject.Find("_GM");
gameSettings = gm.GetComponent<GameSettings>();
diffColor = diffTxt.color;
}
示例3: GameSetup
public GameSetup(string owner, string repo, string token, IEnumerable<Octokit.GitHubCommit> commits)
{
this.hash = HashHelper.GetMD5($"{owner}/{repo}");
this.owner = owner;
this.repository = repo;
this.token = token;
this.commits = commits.ToArray();
this.settings = GameSettings.None;
this.count = commits.Count(filter);
this.messages = new List<Message>();
this.messages.Add(StateMessage.CreateSetup());
this.contributors = new List<Models.Contributor>();
this.users = new List<User>();
Models.GameSettings settings = new Models.GameSettings();
settings.ExcludeMerges = false;
settings.LowerCase = false;
settings.Contributors = GetContributors().Select(x => new Models.GameSettings.Contributor() { Name = x.Name, Active = x.Active }).ToArray();
this.SetSettings(settings);
}
示例4: Start
// Use this for initialization
void Start()
{
target = GameObject.FindWithTag("Player").transform;
myTransform = gameObject.transform;
if (originalPosition == new Vector3(0, 0, 0)) {
Debug.Log("Should set an original position!");
originalPosition = myTransform.position;
}
alarmScript = GameObject.FindWithTag("Alarm").GetComponent<GameSettings>();
string difficulty = alarmScript.getDifficulty();
if (difficulty == "Easy") {
fieldOfView *= 0.75f;
}
else if (difficulty == "Medium") {
rangeOfView *= 1.25f;
moveSpeed *= 2.0f;
}
else if (difficulty == "Hard") {
fieldOfView *= 1.1f;
rangeOfView *= 1.5f;
moveSpeed *= 4.0f;
}
else
Debug.Log("EnemyAI: Difficulty could not be found : " + difficulty);
inCollider = new List<GameObject>();
agent = GetComponent<NavMeshAgent> ();
if (originalPosition == targetPosition || targetPosition == new Vector3(0, 0, 0))
patrol = false;
else {
patrol = true;
agent.SetDestination (targetPosition);
agent.speed = moveSpeed/4;
}
}
示例5: Start
void Start()
{
GameSettings = Settings.GS;
cc = GetComponent<CharacterController>();
MainCamera = Camera.main;
cc.slopeLimit = MaxSlope;
}
示例6: OnLeftClick
protected override void OnLeftClick() {
GameSettings gameSettings = new GameSettings();
gameSettings.IsNewGame = true;
gameSettings.UniverseSize = _universeSize;
gameSettings.PlayerRace = new Race(new RaceStat(_playerRace, "Maxii", new StringBuilder("Maxii description"), _playerColor));
_eventMgr.Raise<BuildNewGameEvent>(new BuildNewGameEvent(this, gameSettings));
}
示例7: TestCascadeFlaggedCells
public void TestCascadeFlaggedCells()
{
int rows = 5;
int cols = 5;
var mines = new List<Point>
{
new Point(cols - 1, rows - 1)
};
IPointGenerator generator = new DeterminatePointGenerator(mines);
IGameSettings settings = new GameSettings(rows, cols, mines.Count, generator);
IMineSearchGame game = new MineSearchGame(settings);
var flaggedPoint = new Point(1, 0);
game.FlagCell(flaggedPoint);
var revealedPoint = new Point(0, 0);
game.RevealCell(revealedPoint);
game.CascadeCell(revealedPoint);
var revealedCells =
game.Cells.Where(cell => cell.Revealed).Select(cell => cell.Coordinates).ToList();
Assert.IsFalse(revealedCells.Contains(flaggedPoint));
}
示例8: BallerburgGame
/// <summary>
/// Initializes a new instance of the BallerburgGame class
/// </summary>
public BallerburgGame()
{
Instance = this;
gameSettings = new GameSettings();
playerSettings = new PlayerSettings[4];
applicationSettings = new ApplicationSettings();
graphics = new GraphicsDeviceManager(this)
{
PreferredBackBufferWidth = 640,
PreferredBackBufferHeight = 480
};
graphicsManager = new BallerburgGraphicsManager();
contentManager = new ContentManager();
shaderManager = new ShaderManager();
audioManager = new AudioManager(applicationSettings, contentManager);
gameObjectManager = new GameObjectManager(contentManager, this.audioManager, this.graphicsManager);
MousePointer = new MousePointer(this)
{
DrawOrder = 1000,
RestrictZone = new Rectangle(0, 0, 640, 480)
};
Components.Add(MousePointer);
// Create the screen manager component.
screenManager = new ScreenManager(graphicsManager, contentManager, gameObjectManager, applicationSettings, gameSettings, shaderManager, audioManager, playerSettings)
{
GameMousePointer = MousePointer
};
}
示例9: SettingsView
public SettingsView(MainMenuView menu)
{
if (File.Exists("settings.json"))
settings = JsonConvert.DeserializeObject<GameSettings>(File.ReadAllText("settings.json"));
else
{
settings = new GameSettings();
settings.EnableClouds = true;
}
scene = new Scene(ScrollInputs.None);
(cloudButton = new FastButton(new Font("Content/font.ttf"), 22, "Content/button.png", "Content/button_hover.png", "Content/button_pressed.png")
{
Position = new Vector2f(500, 200),
Size = new Vector2f(280, 49),
Text = (settings.EnableClouds ? "Disable" : "Enable") + " Clouds",
Anchor = AnchorPoints.Left | AnchorPoints.Top
}).OnClick += ToggleClouds;
(volDownButton = new FastButton(new Font("Content/font.ttf"), 22, "Content/button.png", "Content/button_hover.png", "Content/button_pressed.png")
{
Position = new Vector2f(500, 300),
Size = new Vector2f(40, 49),
Text = "-",
Anchor = AnchorPoints.Left | AnchorPoints.Top
}).OnClick += VolumeDown;
(volUpButton = new FastButton(new Font("Content/font.ttf"), 22, "Content/button.png", "Content/button_hover.png", "Content/button_pressed.png")
{
Position = new Vector2f(740, 300),
Size = new Vector2f(40, 49),
Text = "+",
Anchor = AnchorPoints.Left | AnchorPoints.Top
}).OnClick += VolumeUp;
volumeIndicator = new FastText(new Font("Content/font.ttf"), 22)
{
Position = new Vector2f(550, 300),
Size = new Vector2f(180, 49),
TextAlignment = Alignment.MiddleCenter,
Text = "Volume: " + settings.Volume + "%",
Anchor = AnchorPoints.Left | AnchorPoints.Top
};
(menuButton = new FastButton(new Font("Content/font.ttf"), 22, "Content/button.png", "Content/button_hover.png", "Content/button_pressed.png")
{
Position = new Vector2f(500, 500),
Size = new Vector2f(280, 49),
Text = "Back",
Anchor = AnchorPoints.Left | AnchorPoints.Bottom
}).OnClick += MenuClick;
scene.AddComponent(cloudButton);
scene.AddComponent(menuButton);
scene.AddComponent(volDownButton);
scene.AddComponent(volUpButton);
scene.AddComponent(volumeIndicator);
this.menu = menu;
}
示例10: Read
public static GameSettings Read(string settingsFilename)
{
Stream stream = File.OpenRead(settingsFilename);
XmlSerializer serializer = new XmlSerializer(typeof(GameSettings));
gameSettings = (GameSettings)serializer.Deserialize(stream);
stream.Close();
return gameSettings;
}
示例11: GameWindow
public GameWindow(GameSettings settings)
{
Loaded += WindowLoaded;
KeyDown += WindowKeyDown;
this.settings = settings;
InitializeComponents();
}
示例12: create_icon
GameObject create_icon(StrawberrySingleScore _score, GameSettings.WinCondition _win){
GameObject obj = GameObject.Instantiate(prefab);
var component = obj.GetComponent<ScoreStrawberrySingleView>();
component.strawberry = _score;
component.win = _win;
obj.transform.SetParent(place_icons_here, false);
return obj;
}
开发者ID:mrunderhill89,项目名称:guardian_of_the_fields_the_strawberry_jam,代码行数:8,代码来源:ScoreStrawberryView.cs
示例13: Save
public static void Save(string settingsFilename, GameSettings gameSettings)
{
if (File.Exists(settingsFilename))
File.Delete(settingsFilename);
Stream stream = File.OpenWrite(settingsFilename);
XmlSerializer serializer = new XmlSerializer(typeof(GameSettings));
serializer.Serialize(stream, gameSettings);
stream.Close();
}
示例14: TestInitialize
public void TestInitialize()
{
// Use the default random point generator.
var generator = new RandomPointGenerator();
// Create some simple game settings.
var gameSettings = new GameSettings(4, 4, 4, generator);
// Create a new instance of a game.
_game = new MineSearchGame(gameSettings);
}
示例15: World
public World(GameSettings settings, IInputFactory inputFactory, IGraphicManager graphicManager)
{
iteration = 0;
this.inputFactory = inputFactory;
this.graphicManager = graphicManager;
RainClouds = new List<RainCloud>();
Thunderstorms = new List<Thunderstorm>();
Clouds = new List<Cloud>();
Settings = settings;
}