-
Notifications
You must be signed in to change notification settings - Fork 1
/
CustomModelTower.cs
57 lines (46 loc) · 1.58 KB
/
CustomModelTower.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using BTD_Mod_Helper.Api.Display;
using BTD_Mod_Helper.Api.Towers;
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Models.TowerSets;
using Il2CppAssets.Scripts.Unity.Display;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ExampleMod
{
internal class CustomModelTower : ModTower
{
public override TowerSet TowerSet => TowerSet.Primary;
public override string BaseTower => TowerType.DartMonkey;
public override string Description => "A tower with a custom model & animation. Functionally a dart monkey.";
public override int Cost => 200;
public override string Portrait => Icon;
public override void ModifyBaseTowerModel(TowerModel towerModel)
{
}
}
internal class CustomModelDisplay : ModTowerCustomDisplay<CustomModelTower>
{
public override string AssetBundleName => "examplemod";
public override string PrefabName => "CustomTower";
public override bool UseForTower(params int[] tiers)
{
return tiers.Sum() >= 0;
}
public override void ModifyDisplayNode(UnityDisplayNode node)
{
foreach(var meshRenderer in node.GetMeshRenderers())
{
if (!meshRenderer.name.Contains("Cylinder.003"))
{
meshRenderer.ApplyOutlineShader();
}
meshRenderer.SetOutlineColor(Color.cyan);
}
}
}
}