// Update is called once per frame void Update() { _gameStatu = GameScenceController.getGSController().queryGameStatus(); round = GameScenceController.getGSController()._DiskThrower.round; string score = "Score:" + Convert.ToString(_getScore.getScore()); string round_text = "Round:" + Convert.ToString(round); if (_gameStatu == GameStatus.fail) { billbored.GetComponent <Text>().text = "Fail!\nPress Space to restart!"; } else if (_gameStatu == GameStatus.win) { billbored.GetComponent <Text>().text = "Win!"; } else if (_gameStatu == GameStatus.ing) { billbored.GetComponent <Text>().text = " "; } else if (_gameStatu == GameStatus.load) { billbored.GetComponent <Text>().text = "Press Space to start!\nAfter 5 rounds you will win\nGood Luck!"; } scoreText.GetComponent <Text>().text = score + "\n" + round_text;; }
// Update is called once per frame public void OnClick(GameObject sender) { switch (sender.name) { case "sport": mode = "sport"; GameScenceController.getGSController().setmode(mode); Debug.Log("sport"); Destroy(sport_button); Destroy(physical_button); break; case "Physical": mode = "Physical"; GameScenceController.getGSController().setmode(mode); Destroy(sport_button); Destroy(physical_button); Debug.Log("Physical"); break; default: Debug.Log("none"); break; } }
// Use this for initialization void Start() { GameScenceController my = GameScenceController.getInstance(); my.setSSDirector(this); gameName = "Priests and Devils!"; }
private void Start() { this.round = 1; mode = GameScenceController.getGSController().mode; Reset(round); time = 0; g = 9.8f; }
public void subScore() { score -= 10; if (score <= 0) { GameScenceController.getGSController().setGameStatus(GameStatus.fail); } }
// Use this for initialization void Start() { _controller = GameScenceController.getGSController(); _uerInterface = GameScenceController.getGSController() as IUserInterface; _queryStatus = GameScenceController.getGSController() as IQueryStatus; _Score = GameScenceController.getGSController() as IScore; _controller.setGameStatus(GameStatus.load); }
public void addScore() { score += 10; if (checkUpdate()) { this.round++; GameScenceController.getGSController().update(); } }
// Use this for initialization void Start() { // GameObject bullet = GameObject.Instantiate<GameObject>(bulletPrefab); // bullet.transform.position GameObject plane = GameObject.Instantiate <GameObject>(planePrefab); plane.transform.position = new Vector3(0f, 0f, 70f); _gameStatus = GameStatus.ing; _scenceStatus = ScenceStatus.waiting; _uerInterface = GameScenceController.getGSController() as IUserInterface; _queryStatus = GameScenceController.getGSController() as IQueryStatus; _changeScore = GameScenceController.getGSController() as IScore; }
private void Update() { if (usingDisks != null) { for (int i = 0; i < usingDisks.Count; i++) { if (usingDisks[i].transform.position.y <= usingDisks[i].transform.localScale.y) { GameScenceController.getGSController().destroyDisk(usingDisks[i]); GameScenceController.getGSController().subScore(); } } if (usingDisks.Count == 0) { GameScenceController.getGSController().setScenceStatus(ScenceStatus.waiting); } } }
public void sendDisk(List <GameObject> usingDisks) { this.usingDisks = usingDisks; this.Reset(round); for (int i = 0; i < usingDisks.Count; i++) { var localScale = usingDisks[i].transform.localScale; usingDisks[i].transform.localScale = new Vector3(localScale.x * diskScale, localScale.y * diskScale, localScale.z * diskScale); usingDisks[i].GetComponent <Renderer>().material.color = diskColor; usingDisks[i].transform.position = new Vector3(startPosition.x, startPosition.y + i, startPosition.z); Rigidbody rigibody; rigibody = usingDisks[i].GetComponent <Rigidbody>(); rigibody.WakeUp(); rigibody.useGravity = true; rigibody.AddForce(startDiretion * Random.Range(diskSpeed * 5, diskSpeed * 8) / 5, ForceMode.Impulse); GameScenceController.getGSController().setScenceStatus(ScenceStatus.shooting); } }
//运动学 public void sendDisk2(List <GameObject> usingDisks) { this.usingDisks = usingDisks; this.Reset(round); time = 0; for (int i = 0; i < usingDisks.Count; i++) { var localScale = usingDisks[i].transform.localScale; usingDisks[i].transform.localScale = new Vector3(localScale.x * diskScale, localScale.y * diskScale, localScale.z * diskScale); usingDisks[i].GetComponent <Renderer>().material.color = GetRandomColor(); if (usingDisks.Count % 2 == 1) { usingDisks[i].transform.position = new Vector3(startPosition.x, startPosition.y + i + 8, startPosition.z + 8); } else { usingDisks[i].transform.position = new Vector3(startPosition.x, startPosition.y + i + 8, startPosition.z + 8); } GameScenceController.getGSController().setScenceStatus(ScenceStatus.shooting); } }
private void Update() { if (GameScenceController.getGSController().mode == "sport") { time += Time.deltaTime; if (usingDisks != null) { for (int i = 0; i < usingDisks.Count; i++) { usingDisks[i].transform.Translate(Vector3.down * 5f * time * Time.deltaTime); if (usingDisks.Count % 2 == 1) { usingDisks[i].transform.Translate(Vector3.right * 8f * Time.deltaTime); } else { usingDisks[i].transform.Translate(Vector3.left * 8f * Time.deltaTime); } } } } if (usingDisks != null) { for (int i = 0; i < usingDisks.Count; i++) { if (usingDisks[i].transform.position.y <= usingDisks[i].transform.localScale.y) { GameScenceController.getGSController().destroyDisk(usingDisks[i]); GameScenceController.getGSController().subScore(); } } if (usingDisks.Count == 0) { GameScenceController.getGSController().setScenceStatus(ScenceStatus.waiting); } } }
// Use this for initialization void Start() { GameScenceController.getGSController()._DiskThrower = this.gameObject.AddComponent <DiskThrower>(); }
// Use this for initialization void Start() { my = GameScenceController.getInstance(); action = GameScenceController.getInstance() as IUserActions; }
// Use this for initialization void Start() { my = GameScenceController.getInstance(); my.setGenGameObject(this); loadSource(); }
// Use this for initialization void Start() { GameScenceController.getGSController()._scence = this.gameObject.AddComponent <Scence>(); }
// Update is called once per frame void Update() { string score = Convert.ToString(GameScenceController.getGSController().getScore()); scoreText.GetComponent <Text>().text = "Score:" + score; }
private void OnTriggerEnter() { GameScenceController.getGSController().addScore(); }