Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if ((SceneManager.GetActiveScene().name == ID.SceneNames[(int)ID.Scenes.ARAdd]) && !_GetLoginSceneGameObjects)
     {
         _Shooter                  = GameObject.FindWithTag("MainCamera");
         _ShooterManager           = _Shooter.GetComponent <ShooterManager>();
         _NewARAdd                 = GameObject.FindWithTag("_NewARAdd");
         _ARAddManager             = _NewARAdd.GetComponent <ARAddManager>();
         _GetLoginSceneGameObjects = true;
         Debug.Log(_ARAddManager.ARAddType);
     }
 }
Ejemplo n.º 2
0
    private void DataCollectorManager()
    {
        if ((SceneManager.GetActiveScene().name == ID.SceneNames[(int)ID.Scenes.Login]) && !_GetLoginSceneGameObjects)
        {
            _Name       = GameObject.FindWithTag("_Name");
            _NameText   = _Name.GetComponent <Text>();
            _Age        = GameObject.FindWithTag("_Age");
            _AgeText    = _Age.GetComponent <Text>();
            _Gender     = GameObject.FindWithTag("_Gender");
            _GenderText = _Gender.GetComponent <Text>();
            _Local      = GameObject.FindWithTag("_Local");
            _LocalBool  = _Local.GetComponent <Toggle>();

            _GetLoginSceneGameObjects = true;
        }
        else
        {
            _GetLoginSceneGameObjects = false;
        }
        if ((SceneManager.GetActiveScene().name == ID.SceneNames[(int)ID.Scenes.ARAdd]) && !_GetARAddSceneGameObjects)
        {
            _NewARAdd     = GameObject.FindWithTag("_NewARAdd");
            _ARAddManager = _NewARAdd.GetComponent <ARAddManager>();

            _GetARAddSceneGameObjects = true;
        }
        else
        {
            _GetARAddSceneGameObjects = false;
        }

        // DATA
        if (triggerDataCollector && (SceneManager.GetActiveScene().name == ID.SceneNames[(int)ID.Scenes.Login]))
        {
            _GUID    = System.Guid.NewGuid();
            _counter = 0;
            writeNewUser(_GUID.ToString(), _NameText.text, _AgeText.text, _GenderText.text, _LocalBool.ToString());
            triggerDataCollector = false;
        }
        else if (triggerDataCollector && (SceneManager.GetActiveScene().name == ID.SceneNames[(int)ID.Scenes.ARAdd]))
        {
            _ARAdd            = _ARAddManager.ARAdd;
            _GPSLocalitation  = GameObject.FindWithTag("_GPSLocalitation");
            _GPSLocalitation_ = _GPSLocalitation.GetComponent <GPSLocalitation>();
            if (_ARAdd.tag == "_ARAdd_DataText")
            {
                _NewARAdd_     = GameObject.FindWithTag("_ARAddText");
                _NewARAdd_Text = _NewARAdd_.GetComponent <Text>();
                writeNewARAddData(_GUID.ToString(), _ARAdd.name, _ARAdd.transform.position.ToString(), _GPSLocalitation_.Latitude.ToString(), _GPSLocalitation_.Longitude.ToString(), _NewARAdd_Text.text);
            }
            else if (_ARAdd.tag == "_ARAddTarget")
            {
                //Score
            }
            else if ((_ARAdd.tag != "_ARAdd_DataText") && (_ARAdd.tag != "_ARAddTarget"))
            {
                writeNewARAddData(_GUID.ToString(), _ARAdd.name, _ARAdd.transform.position.ToString(), _GPSLocalitation_.Latitude.ToString(), _GPSLocalitation_.Longitude.ToString());
            }
            triggerDataCollector = false;
        }
    }