Example #1
0
    private IEnumerator CheckInstantiations()
    {
        while (true)
        {
            yield return(new WaitForSeconds(0.5f));

            MothershipController[] motherships = FindObjectsOfType <MothershipController>();
            if (motherships.Length >= Resolver.PLAYERS_COUNT)
            {
                for (int i = 0; i < motherships.Length; i++)
                {
                    if (PhotonNetwork.isMasterClient == motherships[i].isMine)
                    {
                        _masterMothership = motherships[i];
                    }
                    else
                    {
                        _clientMothership = motherships[i];
                    }
                    motherships[i].Initialize();
                }

                _isRoomReadyToPlay = true;
                if (_dataReceiver != null)
                {
                    _dataReceiver.OnDataChanged(_masterMothership.GetSpawnData());
                }
                break;
            }
        }
    }
Example #2
0
 private void ClearRoom()
 {
     StopAllCoroutines();
     _clientShips.Clear();
     _masterShips.Clear();
     _masterMothership  = null;
     _clientMothership  = null;
     _isRoomReadyToPlay = false;
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        scores = new List <int> ()
        {
            50, 100, 150, 200, 250, 300, 350, 400, 450, 500
        };

        MessageController    = FindObjectOfType(typeof(MessageController)) as MessageController;
        MothershipController = FindObjectOfType(typeof(MothershipController)) as MothershipController;
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     mothershipController = (MothershipController)FindObjectOfType(typeof(MothershipController));
     audioSource          = GetComponent <AudioSource> ();
 }
Example #5
0
    // Use this for initialization
    void Start()
    {
        switchToGui ();

        InfoPanel.SetActive(false);
        GameOver.SetActive(false);
        buildMineOnAsteroid.SetActive(false);

        gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>();
        mothershipController = gameController.getMothership().GetComponent<MothershipController>();
        touchScript = GameObject.FindGameObjectWithTag("TouchScript").GetComponent<TouchScript>();
        GameObject androidalke = GameObject.Find ("Android");
        if (androidalke != null)
            android = androidalke.GetComponent<Android>();

        hasGameEnded = false;
        MoveUp = false;
        gamePaused = false;

        CameraMinus = false;
        CameraPlus = false;

        SetupControls();
    }