public void Display(HandedTapValue value)
 {
     if (m_debug && value != null)
     {
         m_debug.text = value.ToString() + "\n" + m_debug.text;
     }
 }
Exemple #2
0
    public void Say(HandedTapValue value)
    {
        HandedComboTowhatToWay combo = CheckForCorresponding(value);

        if (combo != null)
        {
            Debug.Log("...");

            m_displayInfo.SetWith(combo.m_message, value, combo.m_color, combo.m_clip, combo.m_texture);
        }
    }
    public void SetWith(string textToDisplay, HandedTapValue handValue, Color color, AudioClip audio = null, Texture2D image = null)
    {
        SetCommunValues(textToDisplay, color, audio, image);

        DeactivateAll();
        if (m_eloiHand)
        {
            SetComboDisplay(false);
            m_eloiHand.Set(handValue);
        }
    }
Exemple #4
0
    public static TapValue GetTapBasedOnTapWithUsStandard(char character)
    {
        HandedTapValue value = null;

        CharacterToTapWithUsStandard[] valuesFound = TapWithUsStandard.Where(k => k.m_character == character).ToArray();
        if (valuesFound.Length > 0)
        {
            return(valuesFound[0].m_tapvalue);
        }
        else
        {
            return(value);
        }
    }
Exemple #5
0
    public static HandedTapValue GetTapBasedOnEloiStandard(char character)
    {
        HandedTapValue value = null;

        CharacterToEloiStandard[] valuesFound = EloiStandard.Where(k => k.m_character == character).ToArray();
        if (valuesFound.Length > 0)
        {
            return(new HandedTapValue(valuesFound[0].m_handType, valuesFound[0].m_tapValue.m_combo));
        }
        else
        {
            return(value);
        }
    }
    public override bool Equals(object obj)
    {
        if (obj == null)
        {
            return(false);
        }
        if (this.GetType() != obj.GetType())
        {
            return(false);
        }

        HandedTapValue p = (HandedTapValue)obj;

        return((this.m_combo == p.m_combo) && (this.m_handType == p.m_handType));
    }
Exemple #7
0
    private HandedComboTowhatToWay CheckForCorresponding(HandedTapValue value)
    {
        if (value == null)
        {
            return(null);
        }
        HandedComboTowhatToWay[] combos = m_comboToSaying.Where(k => value.m_combo == k.m_combo.m_combo && value.m_handType == k.m_combo.m_handType).ToArray();

        Debug.Log("Try " + combos.Length + " " + value.ToString());
        if (combos.Length > 0)
        {
            return(combos[0]);
        }
        return(null);
    }
Exemple #8
0
    public void Set(HandedTapValue value, bool withReset = true)
    {
        if (value.m_handType == HandType.Left)
        {
            m_left.SetWith(value);
            if (withReset)
            {
                m_right.SetWith(null);
            }
        }
        else if (value.m_handType == HandType.Right)
        {
            m_right.SetWith(value);

            if (withReset)
            {
                m_left.SetWith(null);
            }
        }
    }
Exemple #9
0
    void Update()
    {
        string input = Input.inputString;

        if (input.Length > 0)
        {
            foreach (char c in input.ToCharArray())
            {
                if (m_listenToEloiStandard)
                {
                    HandedTapValue eloiValue = TapUtility.GetTapBasedOnEloiStandard(c);
                    m_onEloiStandardDetected.Invoke(eloiValue);
                }
                if (m_listenToTapWithUsStandard)
                {
                    TapValue tapValue = TapUtility.GetTapBasedOnTapWithUsStandard(c);
                    m_onTapWithUsDetected.Invoke(tapValue);
                }
            }
        }
    }