本文整理汇总了C#中Stopwatch.startStopwatch方法的典型用法代码示例。如果您正苦于以下问题:C# Stopwatch.startStopwatch方法的具体用法?C# Stopwatch.startStopwatch怎么用?C# Stopwatch.startStopwatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stopwatch
的用法示例。
在下文中一共展示了Stopwatch.startStopwatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Get the current scene
// public string currentLevel;
// public int currentLevelNum;
// public float moveTimer;
// Use this for initialization
void Start()
{
cacheCurrentLevelIndex();
if (System.IO.File.Exists ("Save/currentSave"))
System.IO.File.Delete ("Save/currentSave");
displayMessage = false;
displayPauseMenu = false;
bool mattyProfile = false;
bool liquidProfile = false;
bool solidProfile = false;
bool gasProfile = false;
bool plasmaProfile = false;
panTriggerActive = false;
displayTime = 0f;
one = 1f;
messageToBeDisplayed = "";
if (tipDisplayTime == 0f)
tipDisplayTime = 10f;
originalAmbientColor = RenderSettings.ambientLight;
darknessTriggerSpots = new float [2];
sceneCamera = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<Transform>();
camFollow = sceneCamera.gameObject.GetComponent<CameraFollow>();
iciclesList = new System.Collections.Generic.List<IcicleBase> ();
GameObject[] icicleBaseArray = GameObject.FindGameObjectsWithTag ("IceCeiling");
foreach (GameObject icicle in icicleBaseArray)
iciclesList.Add (icicle.GetComponent<IcicleBase>());
darkCave = false;
darkCavesList = new System.Collections.Generic.List<DarkCave>();
icicleBaseArray = GameObject.FindGameObjectsWithTag ("DarkCave");
foreach (GameObject darkCaveEnterX in icicleBaseArray)
{
DarkCave newCave;
Transform dcTransform = darkCaveEnterX.GetComponent<Transform>();
Vector3 dcEnter = dcTransform.Find ("DarkCaveEnter").position;
Vector3 dcExit = dcTransform.Find ("DarkCaveExit").position;
newCave.Door1 = new Vector2 (dcEnter.x, dcEnter.y);
newCave.Door2 = new Vector2 (dcExit.x, dcExit.y);
darkCavesList.Add (newCave);
}
LoadTriggerMessagesFromFile ();
GUIDimensionSetup ();
// Creates a backup of the light intensities of all the lights in the scene.
// This is needed since we need to lerp the light intensities to zero when player
// enters dark caves.
lights = GameObject.FindSceneObjectsOfType (typeof(Light)) as Light[];
origLightIntensities = new float [lights.Length];
for (int i = 0; i < lights.Length; i ++)
origLightIntensities [i] = lights [i].intensity;
// Creates a backup of the skybox assigned to the scene.
// This is needed since we set the skybox to null as the player enters dark caves.
origSkybox = RenderSettings.skybox;
// Needed for dark caves. If background colour is not set to black, dark caves
// won't be "dark" anymore.
sceneCamera.gameObject.GetComponent<Camera>().backgroundColor = Color.black;
// Define the GUIStyle to be used in the State Info Box at the bottom of the screen.
stateInfoBox = new GUIStyle ();
stateInfoBox.name = "StateInfoBox";
stateInfoBox.alignment = TextAnchor.LowerRight;
stateInfoBox.font = menuFont;
stateInfoBox.normal.textColor = Color.white;
player = GameObject.FindGameObjectWithTag ("Player").GetComponent<MainPlayerScript>();
try
{
ld = GameObject.FindGameObjectWithTag ("LevelDirector").GetComponent<LevelDirector>();
}
catch (System.Exception e)
{
Debug.LogWarning ("A Level Director was not found for this level!");
}
try
{
levelStopwatch = GameObject.FindGameObjectWithTag("Stopwatch");
stopwatch = levelStopwatch.GetComponent<Stopwatch>();
if (PlayerPrefs.GetString(Constants.GameModeKey).Equals(Constants.GameModeSpeedRun))
{
stopwatch.startStopwatch();
isSpeedRun = true;
}
player.setIsSpeedRun(isSpeedRun);
//.........这里部分代码省略.........