示例#1
0
    // 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;;
    }
示例#2
0
    // 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;
        }
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        GameScenceController my = GameScenceController.getInstance();

        my.setSSDirector(this);
        gameName = "Priests and Devils!";
    }
示例#4
0
 private void Start()
 {
     this.round = 1;
     mode       = GameScenceController.getGSController().mode;
     Reset(round);
     time = 0;
     g    = 9.8f;
 }
示例#5
0
 public void subScore()
 {
     score -= 10;
     if (score <= 0)
     {
         GameScenceController.getGSController().setGameStatus(GameStatus.fail);
     }
 }
示例#6
0
 // 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);
 }
示例#7
0
 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;
    }
示例#9
0
 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);
         }
     }
 }
示例#10
0
 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);
     }
 }
示例#11
0
    //运动学
    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);
        }
    }
示例#12
0
 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);
         }
     }
 }
示例#13
0
 // Use this for initialization
 void Start()
 {
     GameScenceController.getGSController()._DiskThrower = this.gameObject.AddComponent <DiskThrower>();
 }
示例#14
0
 // Use this for initialization
 void Start()
 {
     my     = GameScenceController.getInstance();
     action = GameScenceController.getInstance() as IUserActions;
 }
示例#15
0
 // Use this for initialization
 void Start()
 {
     my = GameScenceController.getInstance();
     my.setGenGameObject(this);
     loadSource();
 }
示例#16
0
 // Use this for initialization
 void Start()
 {
     GameScenceController.getGSController()._scence = this.gameObject.AddComponent <Scence>();
 }
示例#17
0
    // Update is called once per frame
    void Update()
    {
        string score = Convert.ToString(GameScenceController.getGSController().getScore());

        scoreText.GetComponent <Text>().text = "Score:" + score;
    }
示例#18
0
 private void OnTriggerEnter()
 {
     GameScenceController.getGSController().addScore();
 }