本文整理汇总了C#中GameController类的典型用法代码示例。如果您正苦于以下问题:C# GameController类的具体用法?C# GameController怎么用?C# GameController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GameController类属于命名空间,在下文中一共展示了GameController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
_gameControllerRef = this.GetComponent<GameController>();
eyeClient = GameObject.FindGameObjectWithTag("EyeTribeHandler").GetComponent<EyeTribeClient>();
playerRef = _gameControllerRef.players[0].GetComponent<PlayerController>();
}
示例2: Start
void Start()
{
GameObject gameControllerObject = GameObject.FindWithTag ("GameController");
if (gameControllerObject != null) {
gameController = gameControllerObject.GetComponent<GameController>();
}
}
示例3: Turn
public override void Turn(GameController controller, System.Drawing.Point location)
{
base.Turn(controller, location);
var playerLocation = controller.PlayerLocation;
Active = playerLocation.X == location.X || playerLocation.Y == location.Y;
}
示例4: SceneSwitchers
public void SceneSwitchers(int target)
{
//consider using this for level load stat
controller = GameObject.Find("GameController"); //finds gamecontroller
control = controller.GetComponent<GameController>();
control.SceneSwitchers(target);
}
示例5: Start
// Use this for initialization
void Start()
{
game = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>();
mainCam = GameObject.FindWithTag("MainCamera").camera;
rezzSpot = GameObject.FindWithTag("Player");
}
示例6: Start
// Use this for initialization
void Start()
{
thePlayer = GameObject.FindGameObjectWithTag ("Player");
gameController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController> ();
randomDelay = Random.Range (0, 2);
nextSpawn = Time.time + randomDelay;
}
示例7: Load
public void Load(string path)
{
if(File.Exists(Application.persistentDataPath + path))
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath + path, FileMode.Open);
//deserializing the file so we can get the values back
SaveData saveData = binaryFormatter.Deserialize(file) as SaveData;
//get all components
GameObject gameController = GameObject.FindGameObjectWithTag(Tags.GAMECONTROLLER);
_gameController = gameController.GetComponent<GameController>();
//setting all values
_gameController.level = saveData.level;
_gameController.lives = saveData.lives;
_gameController.checkpointPosition = saveData.checkpointPosition;
_gameController.score = saveData.score;
_gameController.goldCoins = saveData.goldCoins;
//closing the file after every value is set
file.Close();
if (OnGameLoaded != null)
OnGameLoaded();
}
else
{
if (OnNewGame != null)
OnNewGame();
//new game
}
SavePaths.currentPath = path;
}
示例8: Start
void Start()
{
gameController = GameObject.Find("GameController").GetComponent<GameController>();
if (gameController.startingLives - gameController.currentLives != 0)
transform.position = gameController.oldCameraPosition;
}
示例9: Start
void Start()
{
controller = GameObject.Find("Controllers").GetComponent<GameController>();
cageRenderer = GetComponentInChildren<Renderer>();
cageUI = GetComponentInChildren<Canvas>();
startColor = cageRenderer.material.color;
}
示例10: Start
void Start()
{
gc = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>();
navMeshAgent = this.gameObject.GetComponent<NavMeshAgent>();
groundBoundsBox = GameObject.FindGameObjectWithTag("GroundBounds");
SwapSpriteUp();
}
示例11: Awake
protected void Awake()
{
if (Game == null) {
Game = GameController.Instance;
configs = Config.GetConfigs();
}
}
示例12: Start
void Start ()
{
gamecontroller = FindObjectOfType (typeof(GameController)) as GameController;
anim = GetComponentInChildren<Animator> ();
rgd2Player = GetComponent<Rigidbody2D> ();
check = GameObject.Find ("Check").gameObject.transform;
}
示例13: Start
// Use this for initialization
void Start()
{
anim = GetComponent<Animator> ();
gc = (GameController) FindObjectOfType(typeof(GameController));
door = GameObject.FindWithTag ("Door");
anim.enabled = false;
}
示例14: OnButtonStateChanged
protected void OnButtonStateChanged(GameController.ControllerNumber cNum, GameController.Buttons button, bool pressed)
{
if (!_paused)
{
// Take into account special cases:
// 1. Thumbsticks are mouse clicks in cursor mode
if (_cursorMode && button == GameController.Buttons.LeftStick)
{
UnsafeWin32Calls.SendMouseClick(_cursorPositionX, _cursorPositionY, System.Windows.Input.MouseButton.Left, pressed);
return;
}
if (_cursorMode && button == GameController.Buttons.RightStick)
{
UnsafeWin32Calls.SendMouseClick(_cursorPositionX, _cursorPositionY, System.Windows.Input.MouseButton.Right, pressed);
return;
}
KeyBinding kb = _settings.KeyBindings.GetKeyBinding(_triggersPressed, button);
// 2. Swap look/cursor mode
if (pressed && kb.KeyBoardKey == System.Windows.Input.Key.Attn)
{
_cursorMode = !_cursorMode;
return;
}
// Handle normal key clicks
UnsafeWin32Calls.PostKeyClick(kb.KeyBoardKey, kb.Modifier, pressed);
}
}
示例15: Awake
void Awake()
{
game = FindObjectOfType<GameController>();
gravityBoxes = transform.Find("GravityBoxes").GetComponentsInChildren<LogicGravityBox>();
floatyBoxes = transform.Find("FloatyBoxes").GetComponentsInChildren<Rigidbody>();
floatyCables = transform.Find("FloatyCables").GetComponentsInChildren<LogicCable>();
}