コード例 #1
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time.
    /// </summary>
    public void Start()
    {
        m_meshSavePath = Application.persistentDataPath + "/meshes";
        Directory.CreateDirectory(m_meshSavePath);

        m_arPoseController = FindObjectOfType <TangoARPoseController>();
        m_tangoDynamicMesh = FindObjectOfType <TangoDynamicMesh>();

        m_areaDescriptionLoaderPanel.SetActive(true);
        m_meshBuildPanel.SetActive(false);
        m_meshInteractionPanel.SetActive(false);
        m_relocalizeImage.gameObject.SetActive(false);

        // Initialize tango application.
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }

            m_bloonController.Init(m_tangoApplication);
            m_bloonController.SetOnBalloonAddedListener((marker) => {
                Debug.Log("added ballon ctrl");
//				m_markerList.Add(marker);
            });
            m_bloonController.SetOnBalloonPoppedListener((marker) => {
                Debug.Log("popped ballon ctrl");
//				m_markerList.Remove(marker);
            });
        }
    }
コード例 #2
0
ファイル: Control.cs プロジェクト: alen0216056/HCI_Project
 // Use this for initialization
 void Start()
 {
     m_tangoApplication      = FindObjectOfType <TangoApplication>();
     m_tangoARPoseController = FindObjectOfType <TangoARPoseController>();
     m_tangoApplication.Register(this);
     m_tangoApplication.RequestPermissions();
 }
    /// <summary>
    /// Unity Start function.
    ///
    /// This function is responsible for initialization, including setting up m_fileSender and joining or creating a
    /// Photon room.
    /// </summary>
    public void Start()
    {
        m_cubeSize = m_cubePrefab[0].transform.lossyScale.x;

        m_progressPanel.SetActive(false);
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication == null)
        {
            _QuitGame();
        }

        m_tangoApplication.Register(this);
        m_tangoApplication.RequestPermissions();

        m_fileSender = GetComponent <RPCFileSender>();
        m_fileSender.OnPackageReceived         += _OnAreaDescriptionTransferReceived;
        m_fileSender.OnPackageTransferFinished += _OnAreaDescriptionTransferFinished;
        m_fileSender.OnPackageTransferStarted  += _OnAreaDescriptionTransferStarted;
        m_fileSender.OnPackageTransferError    += _OnAreaDescriptionTransferError;

        if (!PhotonNetwork.insideLobby)
        {
            AndroidHelper.ShowAndroidToastMessage("Please wait to join the room until you are in lobby.");
            return;
        }

        if (Globals.m_curAreaDescription == null)
        {
            PhotonNetwork.JoinRandomRoom();
        }
        else
        {
            PhotonNetwork.CreateRoom("Random Room");
        }
    }
コード例 #4
0
    /// <summary>
    /// Start is called on the frame when a script is enabled.
    /// </summary>
    public void Start()
    {
        m_tangoApplication    = FindObjectOfType <TangoApplication>();
        m_characterController = GetComponent <CharacterController>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                // Request Tango permissions
                m_tangoApplication.RequestPermissions();
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it!
                StartCoroutine(_InformUserNoTangoCore());
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }

        SetPose(transform.position, transform.rotation);
    }
コード例 #5
0
 public void Start()
 {
     m_tangoApplication = FindObjectOfType <TangoApplication>();
     if (m_tangoApplication != null)
     {
         m_tangoApplication.Register(this);
         m_tangoApplication.RequestPermissions();
     }
 }
コード例 #6
0
 public void RegisterApplication()
 {
     isNewMap           = false;
     UIManager.gs       = UIManager.guistate.SelecMapMenu;
     m_tangoApplication = FindObjectOfType <TangoApplication>();
     if (m_tangoApplication != null)
     {
         m_tangoApplication.Register(this);
         m_tangoApplication.RequestPermissions();
     }
 }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("ajax list adf startup");

        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            m_tangoApplication.RequestPermissions();
        }
    }
コード例 #8
0
    public void CreateNewMap(string Name)
    {
        isNewMap = true;
        mapName  = Name;

        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            m_tangoApplication.RequestPermissions();
        }
    }
コード例 #9
0
ファイル: ADFSelector.cs プロジェクト: akirayou/withADF
    // Use this for initialization
    void Start()
    {
        dropdown.options.Clear();
        tangoApp.Register(this);
        tangoApp.EnableAreaDescriptions = true;
        tangoApp.Enable3DReconstruction = true;
        //tangoApp.EnableCloudADF = true;
        tangoApp.EnableDepth          = true;
        tangoApp.EnableMotionTracking = true;


        tangoApp.RequestPermissions();
    }
コード例 #10
0
    // Starting functionality
    void Start()
    {
        // Initialize private variables
        rb           = GetComponent <Rigidbody>();
        count        = 0;
        winText.text = "";

        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            m_tangoApplication.RequestPermissions();
        }
    }
コード例 #11
0
    /// <summary>
    /// Unity Start function.
    ///
    /// This function is responsible for connecting callbacks, set up TangoApplication and initialize the data list.
    /// </summary>
    public void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
コード例 #12
0
 public override void OnInit()
 {
     m_tangoApplication       = GetComponent <TangoApplication> ();
     vAreaDescription         = new List <AreaDescription> ();
     m_needNewAreaDescription = true;
     if (m_tangoApplication != null)
     {
         m_tangoApplication.Register(this);
         if (AndroidHelper.IsTangoCorePresent())
         {
             m_tangoApplication.RequestPermissions();
         }
     }
     else
     {
         Debug.Log("No Tango Manager found in scene.");
     }
 }
コード例 #13
0
    /// <summary>
    /// Unity Start function.
    ///
    /// This function is responsible for connecting callbacks, set up TangoApplication and initialize the data list.
    /// </summary>
    void Start()
    {
        // The PlaceMenu start closed.
        isPlaceMenuOpen = false;

        // Tango Initialization
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
コード例 #14
0
    /// <summary>
    /// Unity Start function.
    /// </summary>
    public void Start()
    {
        TangoApplication tangoApplication = FindObjectOfType <TangoApplication>();

        if (tangoApplication != null)
        {
            tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.LogError("No Tango Manager found in scene." + Environment.StackTrace);
            return;
        }
#if UNITY_EDITOR
        PhotonNetwork.ConnectUsingSettings("0.1");
#endif
    }
コード例 #15
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time.
    /// </summary>
    public void Start()
    {
        m_adfMeshSavePath = Application.persistentDataPath + "/ADFMeshes";

        m_arPoseController = FindObjectOfType <TangoARPoseController>();
        m_tangoDynamicMesh = FindObjectOfType <TangoDynamicMesh>();

        m_areaDescriptionLoaderPanel.SetActive(true);
        m_meshBuildPanel.SetActive(false);
        m_meshInteractionPanel.SetActive(false);
        m_relocalizeImage.gameObject.SetActive(false);

        // Initialize tango application.
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
    }
コード例 #16
0
ファイル: TangoPoseController.cs プロジェクト: swushd/swushd
    /// <summary>
    /// Start this instance.
    /// </summary>
    public void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                // Request Tango permissions
                m_tangoApplication.RequestPermissions();
                m_tangoServiceVersionName = TangoApplication.GetTangoServiceVersion();
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it!
                StartCoroutine(_InformUserNoTangoCore());
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
コード例 #17
0
    /// <summary>
    /// Use this for initialization.
    /// </summary>
    public void Start()
    {
#if UNITY_EDITOR
        // We must initialize this on the main Unity thread, since the value
        // is sometimes used within a separate saving thread.
        AreaDescription.GenerateEmulatedSavePath();
#endif

        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);

            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
コード例 #18
0
ファイル: TangoEventManager.cs プロジェクト: ryo0ka/Sightsync
        // Unity function
        void Start()
        {
            tango = FindObjectOfType <TangoApplication>();

            tango.Register(this);

            if (saveAdfButton)
            {
                saveAdfButton.onClick.AddListener(() => {
                    SaveCurrentADF();
                });
            }

            if (connectServiceButton)
            {
                connectServiceButton.onClick.AddListener(() => {
                    ConnectService();
                });
            }

            if (disconnectServiceButton)
            {
                disconnectServiceButton.onClick.AddListener(() => {
                    DisconnectService();
                });
            }

            if (learningAreaToggle)
            {
                learningAreaToggle.isOn = tango.m_enableAreaDescriptions;
                learningAreaToggle.onValueChanged.AddListener(shouldLearn => {
                    // Note that this won't change learning mode of (currently) running service.
                    // This will be applied to service from the next connection.
                    tango.m_areaDescriptionLearningMode = shouldLearn;
                });
            }

            if (requestPermissionsButton)
            {
                requestPermissionsButton.onClick.AddListener(() => {
                    Debug.Log("Requesting permissions...");
                    tango.RequestPermissions();
                    Debug.Log("Requested permissions.");
                });
            }

            if (selectAdfUI)
            {
                selectAdfUI.onAdfSelected += (adf) => {
                    selectedADF = adf;

                    // selectedADF may be null if creating a new ADF.
                    if (adfNameText)
                    {
                        if (selectedADF == null)
                        {
                            // If no ADF is currently selected, blank out the text field.
                            adfNameText.text = "";
                        }
                        else
                        {
                            // If an ADF is selected, reflect the name to the text field.
                            adfNameText.text = selectedADF.GetMetadata().m_name;
                        }
                    }
                };
            }
        }