void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.gameObject.tag == "ObjectModel")
        {
            if (TargetFunctionType == "Navigation")
            {
                NavTo = TargetFunctionData;
                for (int i = 0; i < NavigationContainerPrv.transform.childCount; i++)

                {
                    Debug.Log(NavigationContainerPrv.transform.GetChild(i).gameObject.name + " :: " + NavTo);
                    Debug.Log(NavTo);
                    if (NavTo == NavigationContainerPrv.transform.GetChild(i).GetComponent <PreviewScene>().sceneName)
                    {
                        NavigationContainerPrv.transform.GetChild(i).gameObject.SetActive(true);
                        //set camera rot eulervalues to given rotationView
                        NavigationContainerPrv.transform.GetChild(i).gameObject.GetComponent <PreviewScene>().camPos = rotationView;
                    }
                    else
                    {
                        NavigationContainerPrv.transform.GetChild(i).gameObject.SetActive(false);
                    }
                }
            }
            if (TargetFunctionType == "Text Box")
            {
                GameObject DisplayText = gameObject.transform.parent.GetComponentInChildren <HideInfo>().gameObject;
                DisplayText.SetActive(true);
                DisplayText.GetComponent <HideInfo>().RequireMsg = true;
                TriLib.Samples.PreviewHotspot previewHotspot = gameObject.transform.parent.GetComponent <TriLib.Samples.PreviewHotspot>();
                previewHotspot.Always = true;
                previewHotspot.GetMsg = TargetFunctionData;
            }
        }
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     s = 1;
     previewHotspot = gameObject.transform.parent.GetComponent <TriLib.Samples.PreviewHotspot> ();
     if (previewHotspot.Always == true)
     {
         gameObject.transform.GetChild(0).transform.GetChild(0).GetComponent <Text> ().text = previewHotspot.LableText;
     }
     else
     {
         gameObject.transform.GetChild(0).transform.GetChild(0).GetComponent <Text> ().text = previewHotspot.LableTitle;
     }
 }
Exemplo n.º 3
0
    void OnTriggerEnter(Collider collision)
    {
        if (collision.gameObject.tag == "ObjectModel")
        {
            Debug.Log(collision.gameObject.name);
            if (Model == null)
            {
                Model = collision.gameObject;
                while (OH != null)
                {
                    OH = Model.GetComponentInParent <ObjectHotsot>();
                    OH.transform.localPosition = Vector3.zero;
                    OH.transform.GetChild(0).GetComponent <LookAtTarget>().enabled = true;
                }
            }
            if (TargetFunctionType == "Navigation")
            {
                NavTo = TargetFunctionData;
                for (int i = 0; i < NavigationContainerPrv.transform.childCount; i++)

                {
                    Debug.Log(NavigationContainerPrv.transform.GetChild(i).gameObject.name + " :: " + NavTo);
                    Debug.Log(NavTo);
                    if (NavTo == NavigationContainerPrv.transform.GetChild(i).GetComponent <PreviewScene>().sceneName)
                    {
                        NavigationContainerPrv.transform.GetChild(i).gameObject.SetActive(true);
                        //set camera rot eulervalues to given rotationView
                        NavigationContainerPrv.transform.GetChild(i).gameObject.GetComponent <PreviewScene>().camPos = rotationView;
                        Model.GetComponent <ParentObjectHotspot>().OH.gameObject.transform.localPosition             = Vector3.zero;
                        Model.GetComponent <ParentObjectHotspot>().OH.gameObject.transform.GetChild(0).transform.GetComponent <LookAtTarget>().enabled = true;
                        Model.GetComponent <ParentObjectHotspot>().OH.SelectedModel.transform.GetChild(0).gameObject.SetActive(false);
                    }
                    else
                    {
                        NavigationContainerPrv.transform.GetChild(i).gameObject.SetActive(false);
                    }
                }
            }
            if (TargetFunctionType == "Text Box")
            {
                GameObject DisplayText = gameObject.transform.parent.GetComponentInChildren <HideInfo>().gameObject;
                DisplayText.SetActive(true);
                DisplayText.GetComponent <HideInfo>().RequireMsg = true;
                TriLib.Samples.PreviewHotspot previewHotspot = gameObject.transform.parent.GetComponent <TriLib.Samples.PreviewHotspot>();
                previewHotspot.Always = true;
                previewHotspot.GetMsg = TargetFunctionData;
                gameObject.transform.GetChild(0).gameObject.SetActive(true);
                gameObject.transform.GetChild(0).gameObject.transform.GetChild(0).GetChild(0).GetComponent <Text>().text = previewHotspot.GetMsg;
            }
        }
    }
Exemplo n.º 4
0
 public void changeText()
 {
     previewHotspot = GameObject.FindObjectOfType <TriLib.Samples.PreviewHotspot> ();
     if (s % 2 == 0)
     {
         gameObject.transform.GetChild(0).transform.GetChild(0).GetComponent <Text> ().text = previewHotspot.UserActionName;
         s++;
     }
     else
     {
         gameObject.transform.GetChild(0).transform.GetChild(0).GetComponent <Text> ().text = "456";
         s++;
     }
 }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (NavigationContainerPrv == null)
        {
            NavigationContainerPrv = GameObject.Find("NavigationCanvasPrv");
        }

        if (PreviewHotspotGameobjectName != "")
        {
            if (PreviewHotspot == null)
            {
                GameObject Pre = GameObject.Find(PreviewHotspotGameobjectName);
                PreviewHotspot = Pre.GetComponent <TriLib.Samples.PreviewHotspot>();
            }
        }
    }
Exemplo n.º 6
0
 public void changeText()
 {
     if (previewHotspot == null)
     {
         previewHotspot = gameObject.transform.parent.GetComponent <TriLib.Samples.PreviewHotspot> ();
     }
     if (s % 2 == 0)
     {
         gameObject.transform.GetChild(0).transform.GetChild(0).GetComponent <Text> ().text = previewHotspot.LableTitle;
         s++;
     }
     else
     {
         gameObject.transform.GetChild(0).transform.GetChild(0).GetComponent <Text> ().text = previewHotspot.LableText;
         s++;
     }
 }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     s = 1;
     previewHotspot = GameObject.FindObjectOfType <TriLib.Samples.PreviewHotspot> ();
     gameObject.transform.GetChild(0).transform.GetChild(0).GetComponent <Text> ().text = "acs";
 }