29 lines
872 B
C#
29 lines
872 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Security;
|
|
using BITFALL.Cosmetic;
|
|
using BITKit;
|
|
using BITKit.Entities;
|
|
using BITKit.Steamwork;
|
|
using UnityEngine;
|
|
|
|
namespace BITFALL.Entities.Cosmetic
|
|
{
|
|
[CustomType(typeof(ICosmeticService))]
|
|
public class EntityCosmeticService : EntityBehavior,ICosmeticService
|
|
{
|
|
[SerializeReference, SubclassSelector] private ISteamService steamService;
|
|
|
|
public ICosmetic[] Cosmetics { get; private set; }
|
|
public event Action OnCosmeticsChanged;
|
|
public override async void OnStart()
|
|
{
|
|
base.OnStart();var items =await steamService.GetInventoryItemDefsAsync(destroyCancellationToken);
|
|
//Cosmetics = items.Select(itemDef => Addressables.LoadAssetAsync<ICosmetic>(itemDef.AddressablePath).WaitForCompletion()).ToArray();
|
|
//OnCosmeticsChanged?.Invoke();
|
|
}
|
|
}
|
|
}
|