コード例 #1
0
    void Start()
    {
        motionBase = GameObject.FindGameObjectWithTag("Player");

        if (motionBase != null)
        {
            guiArrows  = motionBase.GetComponentInChildren <GUIArrows>();
            cameraFade = motionBase.GetComponentInChildren <VRCameraFade>();
            HeadTriggerEventScript ht = motionBase.GetComponentInChildren <HeadTriggerEventScript>();
            if (ht != null)
            {
                ht.OnHeadTriggered += ht_OnHeadTriggered;
            }
        }

        if (guiArrows != null)
        {
            guiArrows.Hide();
        }

        recorder = GetComponent <RecordingServiceBehavior>();

        //Don't destroy the motion tracking base when you load the lobby
        DontDestroyOnLoad(motionBase);
        DontDestroyOnLoad(this.gameObject);

        originalTrafficChangeDelay = trafficLightChangeDelay;

        //load lobby
        SceneManager.LoadScene(1);
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        guiArrows = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <GUIArrows>();

        if (guiArrows != null)
        {
            Debug.Log("found gui arrows");
            guiArrows.Hide();
        }

        if (targetOne != null && targetTwo != null)
        {
            targetOneImage = targetOne.GetComponentInChildren <Image>();
            targetTwoImage = targetTwo.GetComponentInChildren <Image>();

            targetOneImage.CrossFadeAlpha(0.0f, 0.1f, true);
            targetTwoImage.CrossFadeAlpha(0.0f, 0.1f, true);

            targetOne.SetActive(false);
            targetTwo.SetActive(false);
        }
    }
コード例 #3
0
ファイル: ExplorerV2.cs プロジェクト: gviaud/OS-unity-5
    //-----------------------------------------------------
    void Start()
    {
        if((PC.DEBUG && DEBUG) || PC.DEBUGALL) Debug.Log(DEBUGTAG+"Start");

        if(m_background == null)
            Debug.LogError(DEBUGTAG+"Background not set, please set it in the inspector.");

        // -- Progress bar --
        r_loadBarFond = new Rect(162,UnityEngine.Screen.height*0.865f,UnityEngine.Screen.width-162*2,4); // new Rect(162,664,700,4);
        r_loadBarGrpMv = new Rect(162,UnityEngine.Screen.height*0.865f,0,4);                 // new Rect(162,664,0,4);
        r_loadBar = new Rect(0,0,UnityEngine.Screen.width-162*2f,4);                         // new Rect(0,0,700,4);

        PlayerPrefs.SetString(usefullData.k_toLoadPath,"");
        PlayerPrefs.SetString(usefullData.k_toLoadParams,"");
        PlayerPrefs.SetString(usefullData.k_startBypass,"");
        //PlayerPrefs.SetString(usefullData.k_selectedClient,"");
        #if UNITY_IPHONE
        EtceteraManager.mailComposerFinishedEvent += IOutils.EndMail;
        #endif

        m_rootPath = usefullData.SavePath;
        m_currentPath = m_rootPath;
        m_projects = new string[0];
        gui_cb = GetComponent<GUIDialogBox>();

        updateClientList();

        arrows = GetComponent<GUIArrows>();
        arrows.setDepth(GUI.depth);

        // -- Rects GUI --
        r_group1            = new Rect();

        r_fullPanelBG       = new Rect(162, 134, 700, 500);
        r_fullPanel         = new Rect(200,150,624,468);
        r_fullPanelSV       = new Rect(0,0,624,468);

        r_halfPanelLeft     = new Rect(162,134+50,350,500-50);
        r_halfPanelLeftSV   = new Rect(0,0,350,500);
        r_backButton        = new Rect(r_halfPanelLeft.x-30, r_halfPanelLeft.y+(r_halfPanelLeft.height-350)/2,30,350);

        r_halfPanelRight    = new Rect(162+350,134,350,500);

        r_leftPanelArrows   = new Rect();
        r_fullPanelBGArrows = new Rect();
        m_useClientSkin = true;

        SetRects();

        if(PlayerPrefs.HasKey(usefullData.k_selectedClient))
        {
            string cl = PlayerPrefs.GetString(usefullData.k_selectedClient);
            if(cl != "")
            {
                for(int i=0;i<m_clients.Length;i++)
                {
                    if(m_clients[i] == cl)
                    {
                        id_selectedClient = i;
                        id_selectedProject = -1;
                        cdm = null;
                        m_currentPath = m_rootPath + m_clients[id_selectedClient];

                        arrows.setArrowsRect(r_leftPanelArrows,"projetUp","projetDwn");
                        m_useClientSkin = false;

                        updateProjectList();
                        if(m_projects.Length>0)
                            autoSelect = true;
                    }
                }
            }
        }
        updateClientList();
    }