private void interactionDone(OVRInput.Controller controller)
    {
        HandVRTooltipController.HideTooltip(controller);

        GameObject hand          = controllerToGameObject.GetOrDefault(controller, null);
        Vector3    startPosition = interactionStartPosition.GetOrDefault(controller, Vector3.zero);
        Vector3    handPosition  = hand?.transform?.position ?? Vector3.zero;

        float startTime = interactionStartTime.GetOrDefault(controller, -1);

        if (startPosition != Vector3.zero && handPosition != Vector3.zero && startTime != -1)
        {
            float distance = Vector3.Distance(startPosition, handPosition);
            float duration = Time.time - startTime;

            Rub rub = new Rub(distance, duration, startTime, LocationName);

            babyRubController.Rubs.Enqueue(rub);
        }

        interactionStartPosition.Remove(controller);
        interactionStartTime.Remove(controller);
    }
Esempio n. 2
0
        /// <summary>
        ///
        /// Menu de Gauche
        ///
        /// </summary>
        public static void RegisterMenu()
        {
            /* Représentation du menu sous forme de dictionnaires */
            menu = new List <Rub>();

            // Rubrique PokerStats
            Rub rub1 = new Rub();

            rub1.label      = "PokerStats";
            rub1.icon       = "fa fa-home";
            rub1.controller = "Home";
            rub1.action     = "Index";
            rub1.srub       = new List <Rub>();

            // Rubrique Règles
            Rub rub2 = new Rub();

            rub2.label      = "Les Règles";
            rub2.icon       = "fa fa-file-text";
            rub2.controller = "Regles";
            rub2.srub       = new List <Rub>();

            // Rubrique Vocabulaire
            Rub rub3 = new Rub();

            rub3.label      = "Le Vocabulaire";
            rub3.icon       = "fa fa-table";
            rub3.controller = "Vocabulaire";
            rub3.srub       = new List <Rub>();

            // Rubrique Stratégies
            Rub rub4 = new Rub();

            rub4.label      = "Les Stratégies";
            rub4.icon       = "fa fa-gear";
            rub4.controller = "Strategies";
            rub4.srub       = new List <Rub>();

            // Rubrique Statistiques
            Rub rub5 = new Rub();

            rub4.label      = "Les Statistiques";
            rub4.icon       = "fa fa-gear";
            rub4.controller = "Statistiques";
            rub4.srub       = new List <Rub>();

            // Rubrique Trackeurs
            Rub rub6 = new Rub();

            rub4.label      = "Les Trackeurs";
            rub4.icon       = "fa fa-gear";
            rub4.controller = "Trackeurs";
            rub4.srub       = new List <Rub>();

            // Rubrique Tournois réels de l'années
            Rub rub7 = new Rub();

            rub4.label      = "Tournois de l'année";
            rub4.icon       = "fa fa-gear";
            rub4.controller = "Tournois";
            rub4.srub       = new List <Rub>();

            /* Défini l'affichage des menus en fonction du rôle l'utilisateur connecté */
            switch (HttpContext.Current.Session["role"].ToString())
            {
            default:
            case "Admin":

                // RUB 1
                menu.Add(rub1);

                // RUB 2
                menu.Add(rub2);

                // RUB 3
                menu.Add(rub3);
                break;

            case "User":

                // RUB 4
                menu.Add(rub4);

                // RUB 5
                menu.Add(rub5);

                // RUB 6
                menu.Add(rub6);

                // RUB 7
                menu.Add(rub7);
                break;
            }
        }