Example #1
0
    //void TimeCheck(float time)
    //{
    //    if (GameObject.Find("sphere screen").GetComponent<FreeViewer>().reviewMode)
    //    {
    //        if (!inRoom308)
    //        {
    //            if (20.6 < time && time < 21.8)
    //            {
    //                enter308BTN.interactable = true;
    //                enter308TXT[0].text = "Enter Room 308";
    //                Debug.Log("Enter room 308");
    //            }
    //            else
    //            {
    //                enter308BTN.interactable = false;
    //                enter308TXT[0].text = "";
    //            }
    //        }
    //    }
    //    else if (inRoom308)
    //    {
    //        if (0 <= time && time < 1.6)
    //        {
    //            enter308BTN.interactable = true;
    //            enter308TXT[0].text = "Back to Aisle";
    //            Debug.Log("Back to Aisle");
    //        }
    //        else
    //        {
    //            enter308BTN.interactable = false;
    //            enter308TXT[0].text = "";
    //        }
    //    }
    ////}

    // Show Annotation
    public void ShowAnnotation()
    {
        string option = dropDown.captionText.text;

        Debug.LogWarning(option);
        var    optionContent = option.Split(',');
        string filePath      = optionContent[0];
        string fileDate      = optionContent[1];

        GameObject.Find("sphere screen").GetComponent <AnnoViewer>().reviewMode         = false;
        GameObject.Find("sphere screen").GetComponent <AnnoViewer>().annotationMode     = false;
        GameObject.Find("sphere screen").GetComponent <AnnoViewer>().playNavigationMode = false;
        //loadTmpTexture(filePath, fileDate);
        var tmp = Resources.Load(filePath) as Texture2D;

        GameObject.Find("sphere screen").GetComponent <Renderer>().material.mainTexture = tmp;
        float camAngle = databasecontrol.GetAnnotaionAngle(fileDate);

        Debug.LogWarning(camAngle);
        Camera.main.transform.eulerAngles = new Vector3(0, camAngle, 0);
        string comment = databasecontrol.GetAnnoatationContent(fileDate);

        Debug.LogWarning(comment);
        UIWindowBase myWindow = Instantiate(annotationWindow, new Vector3((float)0.5 * Screen.width, (float)0.5 * Screen.height, 0), new Quaternion()) as UIWindowBase;

        myWindow.GetComponentInChildren <InputField>().text = comment;
    }
Example #2
0
 //Click annotation BUtton
 void onAnnotationClicked()
 {
     if (!annotationMode)
     {
         annotationMode        = true;
         tmpreviewMode         = reviewMode;
         tmpplayNavigationMode = playNavigationMode;
         reviewMode            = false;
         playNavigationMode    = false;
         annotaionBTN.GetComponentsInChildren <Text>()[0].text = "Save";
         myWindow = Instantiate(annotationWindow, new Vector3((float)0.5 * Screen.width, (float)0.5 * Screen.height, 0), new Quaternion()) as UIWindowBase;
     }
     else
     {
         string annotation = myWindow.GetComponentInChildren <InputField>().text;
         string date       = DateTime.Now.ToString();
         float  camAngle   = Camera.main.transform.eulerAngles.y;
         string fileName   = currentFrameList[currentFrame].name;
         // databaseControl.SaveAnnotation(currentFile, fileName, date, camAngle, annotation);
         Destroy(myWindow.gameObject, 0f);
         annotationMode     = false;
         playNavigationMode = tmpplayNavigationMode;
         reviewMode         = tmpreviewMode;
         annotaionBTN.GetComponentsInChildren <Text>()[0].text = "Annotation";
     }
 }