Ejemplo n.º 1
0
 private void OnItemGazedOff(object sender, GazeEventArgs eventArguments)
 {
     if (currentItem != null)
     {
         currentItem.GazedOff();
     }
 }
Ejemplo n.º 2
0
 protected virtual void OnGazedOff(object sender, GazeEventArgs eventArguments)
 {
     if (eventArguments.Hit.IsChildOf(transform))
     {
         CurrentElement = null;
     }
 }
Ejemplo n.º 3
0
 protected virtual void OnGazedAt(object sender, GazeEventArgs eventArguments)
 {
     if (eventArguments.Hit.IsChildOf(transform))
     {
         CurrentElement = eventArguments.Hit.GetComponent <NavigationElement>();
     }
 }
        protected override void OnGazedOff(object sender, GazeEventArgs eventArguments)
        {
            if (eventArguments.Hit.IsChildOf(transform) && CurrentElement != null)
            {
                CurrentElement.OnGazedOff();
            }

            base.OnGazedOff(sender, eventArguments);
        }
Ejemplo n.º 5
0
        protected override void OnGazedOff(object sender, GazeEventArgs eventArguments)
        {
            if (CurrentElement != null)
            {
                CurrentElement.OnGazedOff();
            }

            base.OnGazedOff(sender, eventArguments);
        }
Ejemplo n.º 6
0
        private void OnItemGazedAt(object sender, GazeEventArgs eventArguments)
        {
            if (eventArguments.Hit.GetComponent <CurvedUIButton>() != null)
            {
                pillars.UIController.GazedAt(eventArguments.Hit.GetComponent <CurvedUIButton>());
                return;
            }

            MenuNode hitNode = eventArguments.Hit.GetComponent <MenuNode>();

            // Maybe we hit a reference node
            if (hitNode == null)
            {
                ReferenceNode reference = eventArguments.Hit.GetComponent <ReferenceNode>();
                hitNode = (reference != null) ? reference.Node : null;
            }

            // Still nothing
            if (hitNode == null)
            {
                return;
            }

            MenuNode node = null;

            // When on the galaxy, only select planets
            if (selectedNode.NodeType == MenuNodeType.Galaxy && hitNode.NodeType == MenuNodeType.Planet)
            {
                node = hitNode;
            }

            // When on a planet, can only focus on anything other then other planets
            else if (selectedNode.NodeType == MenuNodeType.Planet && hitNode.NodeType != MenuNodeType.Pillar && hitNode.NodeType != MenuNodeType.Planet)
            {
                node = hitNode;
            }

            // When on the surface, can only focus on pillar or last planet
            else if (selectedNode.NodeType == MenuNodeType.Surface && (hitNode == lastNode || hitNode.NodeType == MenuNodeType.Pillar))
            {
                node = hitNode;
            }

            // If the node changed
            if (node != null && node != focusedNode && node.NodeType != selectedNode.NodeType)
            {
                // De-select the old one, if one.
                if (focusedNode != null)
                {
                    focusedNode.Focused = false;
                }

                // Change the old one and select it
                focusedNode         = node;
                focusedNode.Focused = true;
            }
        }
        private void OnItemGazedOff(object sender, GazeEventArgs eventArguments)
        {
            if (eventArguments.Hit.GetComponent <CurvedUIButton>() != null)
            {
                CurvedUIController.GazedOff(eventArguments.Hit.GetComponent <CurvedUIButton>());
                return;
            }

            // Nothing is looked at.
            if (GazeWatcher.CurrentGazedItems.Count <= 0 && focusedNode != null)
            {
                focusedNode.Focused = false;
                focusedNode         = null;
            }
        }
        private void OnItemGazedAt(object sender, GazeEventArgs eventArguments)
        {
            if (eventArguments.Hit.GetComponent <CurvedUIButton>() != null)
            {
                CurvedUIController.GazedAt(eventArguments.Hit.GetComponent <CurvedUIButton>());
                return;
            }

            MenuNode hitNode = eventArguments.Hit.GetComponent <MenuNode>();

            // Maybe we hit a reference node
            if (hitNode == null)
            {
                ReferenceNode reference = eventArguments.Hit.GetComponent <ReferenceNode>();
                hitNode = (reference != null) ? reference.Node : null;
            }

            // Still nothing
            if (hitNode == null)
            {
                return;
            }

            MenuNode node = null;

            node = hitNode;

            // If the node changed
            if (node != null && node != focusedNode)
            {
                // De-select the old one, if one.
                if (focusedNode != null)
                {
                    focusedNode.Focused = false;
                }

                // Change the old one and select it
                focusedNode         = node;
                focusedNode.Focused = true;
            }
        }
Ejemplo n.º 9
0
 private void OnItemGazedOff(object sender, GazeEventArgs eventArguments)
 {
 }
Ejemplo n.º 10
0
 private void OnItemGazedAt(object sender, GazeEventArgs eventArguments)
 {
     currentItem = eventArguments.Hit.GetComponent <BaseEquipItem>();
     currentItem.GazedAt();
 }