Exemplo n.º 1
0
    private void OnDragEnded()
    {
        foreach (GameObject obj in instructionObjects)
        {
            InstructionSet set = obj.GetComponent <InstructionSet>();
            if (set != null)
            {
                instructionSets[instructionSetIndex++] = set;
                HUDLogController.QuickMessage("Instruction set found");
            }
        }

        if (instructionSetIndex > 0 && instructionSets[0] != null)
        {
            selectedSet = instructionSets[0];
            bool             failState = false;
            int              count     = 0;
            StepController[] list      = instructionSets[0].GetControllers(out count, out failState);
            if (failState)
            {
                HUDLogController.QuickMessage("failed");
            }
            else
            {
                HUDLogController.QuickMessage("Populate manager ");
                InstructionManager.instance.StepControllers = new List <StepController>(list);
            }
        }
        else
        {
            HUDLogController.QuickMessage("Presenter Nope!!");
        }

        InstructionManager.instance.SetInstructionState(InstructionManager.InstructionStates.Starting);
    }
Exemplo n.º 2
0
    public void SetInstructionState(InstructionStates state)
    {
        switch (state)
        {
        case InstructionStates.Unseen:
            NextButton.SetActive(false);
            BackButton.SetActive(false);
            CloseButton.SetActive(false);
            StartButton.SetActive(false);
            HUDLogController.QuickMessage("Set to Placing");
            break;

        case InstructionStates.Starting:
            NextButton.SetActive(false);
            BackButton.SetActive(false);
            CloseButton.SetActive(false);
            StartButton.SetActive(true);
            HUDLogController.QuickMessage("Set to Starting");
            break;

        case InstructionStates.Using:
            NextButton.SetActive(true);
            BackButton.SetActive(true);
            CloseButton.SetActive(true);
            StartButton.SetActive(false);
            HUDLogController.QuickMessage("Set to Using");
            break;

        default:
            break;
        }
    }
Exemplo n.º 3
0
 private void InteractionManager_SourceLost(InteractionSourceState state)
 {
     // Ensure only the driver cancel detection
     if (controllingID == state.source.id)
     {
         HandDetected = false;
         HUDLogController.QuickMessage("Hand Lost");
     }
 }
Exemplo n.º 4
0
    //// Update is called once per frame
    //void Update()
    //{

    //}
    private void PopulateInstructionManager()
    {
        if (selectedSet != null)
        {
            //InstructionManager.instance.StepControllers = selectedSet.StepControllers;
        }
        else
        {
            HUDLogController.QuickMessage("selectedSet is null ");
        }
    }
Exemplo n.º 5
0
    private void CursorUpdate()
    {
        oldFocusedObject = FocusedObject;
        switch (priority)
        {
        case CursorFocusPriority.Hand:
            if (HandManager.instance.HandDetected)
            {
                HandUpdate();
            }
            else
            {
                GazeUpdate();
            }
            break;

        case CursorFocusPriority.Gaze:
            GazeUpdate();
            break;

        default:
            break;
        }

        // Message sending should be suppressed while dragging
        if (!Dragging)
        {
            // Send Messages
            if (FocusedObject != oldFocusedObject)
            {
                if (FocusedObject != null)
                {
                    FocusedObject.SendMessage("OnFocusEnter", this, SendMessageOptions.DontRequireReceiver);
                    HUDLogController.QuickMessage("Focus Enter " + FocusedObject.name);
                }
                if (oldFocusedObject != null)
                {
                    oldFocusedObject.SendMessage("OnFocusExit", this, SendMessageOptions.DontRequireReceiver);
                    HUDLogController.QuickMessage("Focus Exit " + oldFocusedObject.name);
                }
            }
            else
            {
                if (FocusedObject != null)
                {
                    FocusedObject.SendMessage("OnFocusOver", this, SendMessageOptions.DontRequireReceiver);
                }
            }
        }
        else
        {
            DraggedObject.transform.position = mesh.transform.position;
        }
    }
Exemplo n.º 6
0
 public void OnNextPressed()
 {
     if (StepIndex < StepControllers.Count)
     {
         HUDLogController.QuickMessage("Next Pressed");
         GameObject obj = Instantiate(StepControllers[StepIndex].gameObject, PresentationSpace.transform) as GameObject;
         StepArray[StepIndex]    = obj.gameObject;
         CurrentStep             = obj.gameObject;
         obj.transform.position += PresentationSpace.transform.position;
         StepIndex++;
     }
 }
Exemplo n.º 7
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        HUDLogController.QuickMessage("Gaze Manager Checking In");
    }
Exemplo n.º 8
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     logText       = GetComponent <Text>();
     logText.color = messageColor;
 }
Exemplo n.º 9
0
 public void OnStartPressed()
 {
     HUDLogController.QuickMessage("StepControllers Count " + StepControllers.Count.ToString());
     if (StepControllers.Count > 0)
     {
         StepIndex = 0;
         GameObject obj = Instantiate(StepControllers[StepIndex].gameObject, PresentationSpace.transform) as GameObject;
         StepArray[StepIndex]    = obj.gameObject;
         CurrentStep             = obj.gameObject;
         obj.transform.position += PresentationSpace.transform.position;
         StepIndex++;
         SetInstructionState(InstructionStates.Using);
     }
 }
Exemplo n.º 10
0
 private void InteractionManager_SourceDetected(InteractionSourceState state)
 {
     // Ensure only one hand is driving
     if (!HandDetected)
     {
         HUDLogController.QuickMessage("Hand Detected");
         HandDetected  = true;
         controllingID = state.source.id;
         Vector3 handPosition;
         if (state.properties.location.TryGetPosition(out handPosition))
         {
             HandPosition = handPosition;
         }
     }
 }
Exemplo n.º 11
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        HUDLogController.QuickMessage("Hand Manager Checking In");
        HandDetected = false;
        HandPosition = new Vector3(0, 0, 0);
    }
Exemplo n.º 12
0
    public void UpdateBounds()
    {
        HUDLogController.QuickMessage("UpdateBounds Called");
        Bounds  b          = new Bounds();
        Vector3 newExtents = minExtents;

        //Create a bounds structure with extents that include all insta
        try
        {
            foreach (GameObject obj in StepArray)
            {
                MeshFilter filter = obj.GetComponent <MeshFilter>();
                if (filter != null)
                {
                    Vector3 max = filter.mesh.bounds.max;
                    if (Mathf.Abs(max.x) > Mathf.Abs(newExtents.x))
                    {
                        newExtents.x = Mathf.Abs(max.x);
                    }

                    if (Mathf.Abs(max.y) > Mathf.Abs(newExtents.y))
                    {
                        newExtents.y = Mathf.Abs(max.y);
                    }

                    if (Mathf.Abs(max.z) > Mathf.Abs(newExtents.z))
                    {
                        newExtents.z = Mathf.Abs(max.z);
                    }
                }
            }
            b.extents = newExtents;
            b.center  = new Vector3(0, 0, 0);
            HUDLogController.instance.AddToLog("x: " + newExtents.x + " y: " + newExtents.y + " z: " + newExtents.z,
                                               HUDLogController.LogMessageTypes.Message, false);
            CanvasManager.ResizeCanvas(b);
        }
        catch (UnityException e)
        {
            HUDLogController.QuickMessage("ProblemWithUpdateBOunds");
            HUDLogController.QuickError(e.ToString());
        }
    }
Exemplo n.º 13
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        HUDLogController.QuickMessage("Smart Cursor Checking In");
        mesh = GetComponent <MeshRenderer>();

        GameObject eye = GameObject.Find("EyeIcon");

        eyeRenderer = eye.GetComponent <SpriteRenderer>();

        GameObject hand = GameObject.Find("HandIcon");

        handRenderer = hand.GetComponent <SpriteRenderer>();
    }
Exemplo n.º 14
0
        void OnGazeExit()
        {
            HUDLogController.QuickError(name + " exited");

            MaterialPropertyBlock mpb = new MaterialPropertyBlock();

            _Renderer.GetPropertyBlock(mpb);
            mpb.SetFloat("_Outline", 0);
            _Renderer.SetPropertyBlock(mpb);

            ARButtonEventArgs args = new ARButtonEventArgs()
            {
                GazeFocused     = false,
                HandFocused     = false,
                PriorityFocused = true
            };

            OnExitedHandler handler = OnExited;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemplo n.º 15
0
 // Use this for initialization
 void Start()
 {
     HUDLogController.QuickMessage("Presenter Starting!!");
 }
Exemplo n.º 16
0
 public void OnLaunchClick()
 {
     HUDLogController.QuickMessage("Launch Pressed");
 }
Exemplo n.º 17
0
 private void OnDragStarted()
 {
     HUDLogController.QuickError("Drag started");
     InstructionManager.instance.SetInstructionState(InstructionManager.InstructionStates.Unseen);
 }
Exemplo n.º 18
0
 public void OnClosePressed()
 {
     HUDLogController.QuickMessage("Close Pressed");
 }
Exemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     HUDLogController.QuickMessage("Something");
 }