Ejemplo n.º 1
0
        public GestureMatchEventArgs(ImageGestureImage match)
        {
            MatchName = match.Name;

            MatchedPercent = match.Score * 100;
        }
Ejemplo n.º 2
0
    private void LateUpdate()
    {
        if (hasDrawned && firstTime && isInBossPanel && !onlyBasicAttack)
        {
            hasDrawned = false;
            ImageGestureImage match = ImageScript.CheckForImageMatch();

            if (match != null) //  && match.Name == selectedSpell.sSpellName
            {
                Debug.Log(match.Name + " == " + selectedSpell.sSpellName);
                Debug.Log("Match Score : " + match.Score);
                firstTime = false;
                var shape = MatchParticleSystem.shape;
                MatchParticleSystem.transform.localPosition = ConvertToWorldUnits(lastX, lastY);
                MatchParticleSystem.Play();
                Debug.Log("Match Found: " + match.Name);
                SwipeInstructionText.text = "You casted " + match.Name;
                //TODO: Maybe scrap out ICombatSpell interface, and stick with just Spell (after graduation).
                ICombatSpell combatSpell = (ICombatSpell)selectedSpell;
                try
                {
                    combatSpell.CombatCast(localSpellcaster, orbPercentage);

                    // only call this if combat spell did damage
                    if (((Spell)combatSpell).damageSpell)
                    {
                        spellProjectile.GetComponent <UIWanderingProjectile>().Launch();
                        // get damage from combat spell
                        damageText.text = ((Spell)combatSpell).damageDealt + " damage!";
                    }
                }
                catch { }
                //NetworkManager.s_Singleton.CombatSpellCast(selectedSpell.sSpellName, match.Score);
                //AudioSourceOnMatch.Play();
                swipeGuideSpawner.selectedSpell.SetActive(false);
                ResetButton.gameObject.SetActive(true);
            }
            else
            {
                //Debug.Log(match.Name + " != " + selectedSpell.sSpellName);
                Debug.Log("No match found!");
            }
        }
        // TODO: Do something with the match
        // You could get a texture from it:
        // Texture2D texture = FingersImageAutomationScript.CreateTextureFromImageGestureImage(match);
        //}

        try
        {
            if (NetworkGameState.instance.IfBossAttacked())
            {
                DialogueField.SetActive(true);
                DialogueField.transform.GetChild(0).GetComponent <Text>().text = "The Black Mage dealt " + ((int)NetworkGameState.instance.GetBossAttackDamage()).ToString() + " damage to everyone!";
            }
        }
        catch
        {
            //If we are here that means we are testing.
        }
    }