示例#1
0
    private void SetSpecial(SkillPath.Special special)
    {
        switch (special)
        {
        case SkillPath.Special.DASH:
            gameObject.AddComponent <Dash>();
            this.special = GetComponent <Dash>();
            break;

        case SkillPath.Special.THROWSWORD:
            gameObject.AddComponent <ThrowProjectile>();
            gameObject.GetComponent <ThrowProjectile>().projectile      = thrownSword;
            gameObject.GetComponent <ThrowProjectile>().projectileForce = 4;
            gameObject.GetComponent <ThrowProjectile>().minDamage       = 10;
            gameObject.GetComponent <ThrowProjectile>().maxDamage       = 35;
            gameObject.GetComponent <ThrowProjectile>().shotSpread      = 1;
            gameObject.GetComponent <ThrowProjectile>().projKnockback   = 8f;
            gameObject.GetComponent <ThrowProjectile>().Initialise();
            this.special = GetComponent <ThrowProjectile>();
            break;

        case SkillPath.Special.FIREBALL:
            gameObject.AddComponent <ThrowProjectile>();
            gameObject.GetComponent <ThrowProjectile>().projectile      = specialFireball;
            gameObject.GetComponent <ThrowProjectile>().projectileForce = 6;
            gameObject.GetComponent <ThrowProjectile>().minDamage       = 25;
            gameObject.GetComponent <ThrowProjectile>().maxDamage       = 30;
            gameObject.GetComponent <ThrowProjectile>().shotSpread      = 1;
            gameObject.GetComponent <ThrowProjectile>().projKnockback   = 0.5f;
            gameObject.GetComponent <ThrowProjectile>().Initialise();
            this.special = GetComponent <ThrowProjectile>();
            break;

        default:
            break;
        }
    }
    private void CreateBlankSkillJson(SkillPath.Weapon weapon, SkillPath.Special special)
    {
        string skillsString = JsonUtility.ToJson(new SkillPath(weapon, special));

        File.WriteAllText(Path.Combine(Application.dataPath, "skills", "blank.json"), skillsString);
    }