-
Notifications
You must be signed in to change notification settings - Fork 4
/
Helper.cs
34 lines (30 loc) · 1.08 KB
/
Helper.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
using System.IO;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack;
using Il2CppAssets.Scripts.Unity;
using Il2CppAssets.Scripts.Unity.Display;
using BTD_Mod_Helper.Extensions;
using UnityEngine;
namespace VoidBananaFarmer
{
public static class Helper
{
private static readonly int MainTex = Shader.PropertyToID("_MainTex");
public static TowerModel BaseBananaFarmer => Game.instance.model.GetTowerFromId("BananaFarmer");
public static string BananaFarmerDisplay => BaseBananaFarmer.display.guidRef;
public static void UpdateHatTexture(UnityDisplayNode node, Texture tex)
{
node.genericRenderers[0].materials[1].SetTexture(MainTex, tex);
}
public static void UpdateAttackModelRange(TowerModel spainico)
{
if (spainico.HasBehavior<AttackModel>())
{
foreach (var attackModel in spainico.GetAttackModels())
{
attackModel.range = spainico.range;
}
}
}
}
}