예제 #1
0
파일: Scenary.cs 프로젝트: Fonserbc/ETLYT
    void Update()
    {
        if(!started){
            time2 -= Time.deltaTime;
            if(time2 <= 0) {
                time2 += time/numPlayers;
                bi = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent<BattleInformer>();
                bi.initPlayers(initPosition[cont],cont);
                ++cont;
                if(cont == numPlayers) {
                    started = true;
                    bi.initFight();
                }
            }
        } else {
            if(!finished) {
                numPlayers = bi.getPlayersInGame();
                if(numPlayers <= 1) {
                    finished = true;
                    Time.timeScale = 0.5f;
                }
            } else {
                timefinish -= 2*Time.deltaTime;
                if(timefinish <= 0) {
                    Destroy (GameObject.FindGameObjectWithTag("BattleInformer"));
                    Application.LoadLevel(Application.loadedLevel - 1);
                }
            }

        }
    }
예제 #2
0
 void Start()
 {
     control    = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>();
     bi         = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent <BattleInformer>();
     maxPlayers = bi.getMaxPlayers();
     players    = new bool[maxPlayers];
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        Control control = GameObject.FindGameObjectWithTag("Control").GetComponent<Control>();
        count = WiiMoteControl.wiimote_count();

        bi = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent<BattleInformer>();
    }
예제 #4
0
    private bool[] players; //iremos marcando que numero de mando esta en funcionamiento

    #endregion Fields

    #region Methods

    void Start()
    {
        control = GameObject.FindGameObjectWithTag("Control").GetComponent<Control>();
        bi = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent<BattleInformer>();
        maxPlayers = bi.getMaxPlayers();
        players = new bool[maxPlayers];
    }
예제 #5
0
    // Use this for initialization
    void Start()
    {
        Control control = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>();

        count = WiiMoteControl.wiimote_count();

        bi = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent <BattleInformer>();
    }
예제 #6
0
 void Update()
 {
     if (!started)
     {
         time2 -= Time.deltaTime;
         if (time2 <= 0)
         {
             time2 += time / numPlayers;
             bi     = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent <BattleInformer>();
             bi.initPlayers(initPosition[cont], cont);
             ++cont;
             if (cont == numPlayers)
             {
                 started = true;
                 bi.initFight();
             }
         }
     }
     else
     {
         if (!finished)
         {
             numPlayers = bi.getPlayersInGame();
             if (numPlayers <= 1)
             {
                 finished       = true;
                 Time.timeScale = 0.5f;
             }
         }
         else
         {
             timefinish -= 2 * Time.deltaTime;
             if (timefinish <= 0)
             {
                 Destroy(GameObject.FindGameObjectWithTag("BattleInformer"));
                 Application.LoadLevel(Application.loadedLevel - 1);
             }
         }
     }
 }
예제 #7
0
    // Use this for initialization
    void Start()
    {
        Physics.gravity = new Vector3(0, -9.81f, 0);
        Time.timeScale  = 1.0f;
        Control        control = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>();
        BattleInformer bi      = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent <BattleInformer>();

        int c = WiiMoteControl.wiimote_count();

        if (c > 0)
        {
            for (int i = 0; i <= c - 1; i++)
            {
                //control.RegisterPlayer(Control.ControllerType.WiiMote, i);
                bi.changePlayer(standardAvatar, i, 0);
            }
        }
        else
        {
            Debug.Log("No hay mandos, tolai!");
        }
    }
예제 #8
0
 // Use this for initialization
 void Start()
 {
     selection.Play();
     bi         = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent <BattleInformer>();
     numPlayers = bi.getNumPlayers();
 }
예제 #9
0
파일: Scenary.cs 프로젝트: Fonserbc/ETLYT
 // Use this for initialization
 void Start()
 {
     selection.Play();
     bi = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent<BattleInformer>();
     numPlayers = bi.getNumPlayers();
 }
예제 #10
0
 // Use this for initialization
 void Start()
 {
     control = GameObject.FindGameObjectWithTag("Control").GetComponent<Control>();
     bi = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent<BattleInformer>();
 }
예제 #11
0
 // Use this for initialization
 void Start()
 {
     control = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>();
     bi      = GameObject.FindGameObjectWithTag("BattleInformer").GetComponent <BattleInformer>();
 }