41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
using Framework;
|
|
using Gameplay.Net;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class VehiclePaintHelper : MonoBehaviour
|
|
{
|
|
public static List<int> GetAllPaint(int vehicleID)
|
|
{
|
|
List<int> ret = new();
|
|
var data = TableManager.Instance.Tables.VehiclePaint.DataList;
|
|
for (int i = 0; i < data.Count; i++)
|
|
{
|
|
if (data[i].HostVehicle == vehicleID)
|
|
{
|
|
ret.Add(data[i].PaintID);
|
|
}
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
public static bool IsPaintUnlocked(int vehicleID, int paintID)
|
|
{
|
|
var cfg = TableManager.Instance.Tables.VehiclePaint.Get(paintID);
|
|
if (cfg == null || cfg.HostVehicle != vehicleID)
|
|
{
|
|
return false;
|
|
}
|
|
var vehicleData = Actor.Instance.Character.GetVehicleDevelopment(vehicleID);
|
|
if (vehicleData == null)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return CategoryManager.Instance.GetItemCount(cfg.ItemID) > 0;
|
|
}
|
|
}
|
|
}
|