Log in or register to post comments

2 objects different URL link for each

March 12, 2013 - 11:31am #1

Hey guys,

I was able to use this scrpt and modify it to make an oject plane into a link, but now I want to make multiple objects into seperate links. I think I need to define the oject name and assign the specific link to that object. But I'm having some trouble with the coding. please help.

This is what I have so far.

 

using UnityEngine;
using System.Collections;
 
public class NorthCamlink : MonoBehaviour {
    bool isHighlighted = false;
Material originalMaterial;
Material redMaterial;
MeshRenderer meshRenderer;
 
GameObject baseObject;
string obj_name;
// Use this for initialization
void Start () {
 
obj_name = this.gameObject.name + "Base";
baseObject = GameObject.Find( obj_name );
meshRenderer = baseObject.GetComponent<MeshRenderer>();
originalMaterial = meshRenderer.material;
 
 
}
 
// Update is called once per frame
void Update () {
 
}
 
void OnMouseDown(){
 
{
 
    Application.OpenURL ("http://westislandmedia.com");
 
 
}
}
}
 

2 objects different URL link for each

March 12, 2013 - 5:41pm #3

I figured it out. Thank you for posting links

2 objects different URL link for each

March 12, 2013 - 1:38pm #2

This thread discusses a few approaches to handling touches for discrete objects - https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/touch-3d-object-call-website

Personally I like this approach - https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/how-add-touch-listener-3d-object-unity

You define a global touch listener, which you can add to the ARCamera, that then dispatch touches as OnMouseDown events to the touched objects. This enables you to isolate behaviors for objects using the individual scripts that you assign to those objects.

Log in or register to post comments