Book Image

Unity Game Development Scripting

By : Kyle D'Aoust
Book Image

Unity Game Development Scripting

By: Kyle D'Aoust

Overview of this book

Table of Contents (17 chapters)
Unity Game Development Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Making video configurations


One of the first aspects of the game that we will be editing is the video configuration. When it comes to performance, the video settings are perhaps the most important. Changing something as simple as the shadows can greatly change how a player can smoothly play the game. So let's get started by creating a new C# script and naming it Video_Config.

Setting the values

Our first step in creating video configurations is to create a function that will set a default value for the video settings. For this, we will set the video settings to moderate values that aren't too low or too high. This will give the player a good idea of what they need to modify if they need or want to modify anything:

public void SetDefaults()
{
  SetSettings("Medium");
  ToggleShadows(1);
  SetFOV(90.00f);
  SetResolution(0, 1);
  SetAA(2);
  SetVsync(1);
}

What this function does is call all of the functions that we create, which will configure the video settings. The values that we send to each...