Exemple #1
0
        public string GetPlayerData()
        {
            // data for each gesture (including successful and failed)
            string player_data = "";

            player_data += PlayingData.GetInstance().PlayerData.GetJsonString();
            player_data += PlayingData.GetInstance().GetResultJsonString();

            GameObject _leapServiceProvider = GameObject.Find("LeapMotionServiceProvider");

            _leapServiceProvider.GetComponent <HandStateTracker>().dataList.Add("]\n");
            _leapServiceProvider.GetComponent <GestureTracker>().dataList.Add("]");
            for (int i = 0; i < _leapServiceProvider.GetComponent <HandStateTracker>().dataList.Count; i++)
            {
                player_data += _leapServiceProvider.GetComponent <HandStateTracker>().dataList[i];
            }
            player_data += ",";
            for (int i = 0; i < _leapServiceProvider.GetComponent <GestureTracker>().dataList.Count; i++)
            {
                player_data += _leapServiceProvider.GetComponent <GestureTracker>().dataList[i];
            }
            player_data += "}";

            return(player_data);
        }
Exemple #2
0
        public void InitGestureCheck()
        {
            // Ignore check the previous gesture completion when just to do the first gesture
            if (!m_firstGesture)
            {
                if (m_justEnter && !m_isCompleted)
                {
                    m_gameWorld.ShowHUDMiss();
                    PlayingData.GetInstance().AddGestureDataBy(m_playerClass.PrevRaycastingTag, false);
                }
                m_justEnter   = false;
                m_isCompleted = false;
            }

            // First and foremost, the tag should be available for checking
            if (m_tagActionDict.ContainsKey(m_playerClass.RaycastingTag))
            {
                m_tag          = m_playerClass.RaycastingTag;
                m_isChecked    = false;
                m_firstGesture = false;
                m_justEnter    = true;
            }
            else                 // if the component tag does not exist, ingore this check
            {
                Debug.Log("The component tag does not exist");
                m_isChecked = true;
            }
        }
Exemple #3
0
 public void SavePlayerData()
 {
     //BinaryFormatter bf = new BinaryFormatter();
     //FileStream file = File.Create(m_playerDataPath);
     //bf.Serialize(file, m_playerData);
     //file.Close();
     File.AppendAllText(m_playerDataPath, PlayingData.GetInstance().ToString());
 }
Exemple #4
0
        public void Analysis()
        {
            if (m_isChecked == true)
            {
                return;
            }

            CharacterAction char_action = GameDictionary.PairedAction[m_gestureTracker.GetIdentifiedGesture()];

            if (m_tagActionDict.ContainsKey(m_playerClass.RaycastingTag) && char_action == m_tagActionDict[m_playerClass.RaycastingTag])
            {
                m_isChecked   = true;
                m_isCompleted = true;
                m_gameWorld.ShowHUDComplete();
                PlayingData.GetInstance().AddGestureDataBy(m_playerClass.RaycastingTag, true);
            }
        }