Пример #1
0
    /* point directly to node */
    public float ShowArrow(GameObject markerObject, GameObject destinationNode)
    {
        GameObject  arrowObj = GetARObjectOfType(markerObject, ARObject.Type.Arrow);
        ArrowScript arrowsc  = arrowObj.GetComponent <ArrowScript>();

        arrowsc.PointToCoordinate(destinationNode.GetComponent <NodeData>().position);
        arrowObj.SetActive(true);
        SendLastObject(arrowsc.Type);
        return(arrowObj.transform.localRotation.eulerAngles.z);
    }
Пример #2
0
    /* get command from maincontroller
     * detect marker show/lost from markerConstructor
     * control arrow up/down*/

    #region Display AR
    /* point arrow to successor's position.  if null, point to destination */
    public float ShowArrow(GameObject markerObject, bool navigatable)
    {
        Debug.Log(markerObject.name);
        GameObject  objectNodeToAugment = markerObject.GetComponent <MarkerData>().GetParentNodeObject();
        GameObject  arrowObj            = GetARObjectOfType(markerObject, ARObject.Type.Arrow);
        ArrowScript arrowsc             = arrowObj.GetComponent <ArrowScript>();

        if (navigatable || objectNodeToAugment.GetComponent <NodeData>().successor != null)
        {
            arrowsc.PointToCoordinate(objectNodeToAugment.GetComponent <NodeData>().successor.GetComponent <NodeData>().position);
            Debug.Log("Point to " + objectNodeToAugment.GetComponent <NodeData>().successor.name);
        }
        else
        {
            Debug.Log("Can't navigatable");
            arrowsc.PointToCoordinate(objectNodeToAugment.GetComponent <NodeData>().position);
        }
        arrowObj.SetActive(true);
        SendLastObject(arrowsc.Type);
        return(arrowObj.transform.localRotation.eulerAngles.z);
    }