Beispiel #1
0
    /// <summary>
    /// Finishes the fire blow. Blow out animation
    /// </summary>
    public void FinishFireBlow()
    {
        animator.SetTrigger("FireBlowOut");
        animator.SetBool("IsFireBlowIn", false);

        // spawn the particle effect
        ImmutableDataSkill curSkill            = DataLoaderSkills.GetFlameAtLevel((int)LevelLogic.Instance.CurrentLevel);
        string             flameResourceString = curSkill.FlameResource;
        GameObject         flamePrefab         = Resources.Load(flameResourceString) as GameObject;
        GameObject         flameObject         = Instantiate(flamePrefab, new Vector3(0, 0, 0), flamePrefab.transform.rotation) as GameObject;

        // parent it to the right position
        flameObject.transform.parent        = fireBlowPosition.transform;
        flameObject.transform.localPosition = new Vector3(0, 0, 0);

        // actually kick off the effect
        fireScript = flameObject.GetComponent <FireBlowParticleController>();
        fireScript.Play();
    }
Beispiel #2
0
    /// <summary>
    /// Listen to pet level up and Checks the flame level up.
    /// </summary>
    private void CheckFlameLevelUp(object sender, EventArgs args)
    {
        if (allSkills == null)
        {
            allSkills = SortList(DataLoaderSkills.GetDataList());
        }

        int currentLevel = (int)LevelLogic.Instance.CurrentLevel;

        ImmutableDataSkill skillData = DataLoaderSkills.NewFlameOnLevelUp(currentLevel);

        if (skillData != null)
        {
            if (OnFlameLevelUp != null)
            {
                FlameLevelEventArgs flameArgs = new FlameLevelEventArgs(skillData);
                OnFlameLevelUp(this, flameArgs);
            }
        }
    }
Beispiel #3
0
 void Awake()
 {
     allSkills = SortList(DataLoaderSkills.GetDataList());
 }