Esempio n. 1
0
        internal static void AddSimpleVariant(string bodyName, float spawnRate, MonsterVariantTier tier, MonsterSizeModifier size, float health, float moveSpeed, float attackSpeed, float damage, float armor, float armorBonus, int alienHeads, Material replacementMaterial, Mesh replacementMesh)
        {
            MonsterMaterialReplacement[] replacementMats = null;
            if (replacementMaterial != null)
            {
                replacementMats = SimpleMaterialReplacement(replacementMaterial);
            }

            MonsterVariantInfo newInfo = new MonsterVariantInfo
            {
                bodyName              = bodyName,
                spawnRate             = spawnRate,
                variantTier           = tier,
                sizeModifier          = size,
                healthMultiplier      = health,
                moveSpeedMultiplier   = moveSpeed,
                attackSpeedMultiplier = attackSpeed,
                damageMultiplier      = damage,
                armorMultiplier       = armor,
                armorBonus            = armorBonus,
                customInventory       = SimpleInventory("AlienHead", alienHeads),
                meshReplacement       = null,
                materialReplacement   = replacementMats,
                skillReplacement      = null,
                buff = BuffIndex.None
            };

            Components.VariantHandler variantHandler = Resources.Load <GameObject>("Prefabs/CharacterBodies/" + bodyName + "Body").AddComponent <Components.VariantHandler>();
            variantHandler.Init(newInfo);
        }
Esempio n. 2
0
        public static void AddVariant(GameObject bodyPrefab, MonsterVariantInfo info)
        {
            if (!bodyPrefab)
            {
                Debug.LogError("Failed to add variant: Invalid body prefab");
                return;
            }

            Components.VariantHandler variantHandler = bodyPrefab.AddComponent <Components.VariantHandler>();
            variantHandler.Init(info);
        }
Esempio n. 3
0
 // helper to simplify adding a variant
 internal static void AddVariant(MonsterVariantInfo info)
 {
     Components.VariantHandler variantHandler = Resources.Load <GameObject>("Prefabs/CharacterBodies/" + info.bodyName + "Body").AddComponent <Components.VariantHandler>();
     variantHandler.Init(info);
 }