Second commit
This commit is contained in:
commit
36840f3ad4
999 files changed
+61364
No files matched your search
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.D.Cleaning.UI
|
||||
{
|
||||
public abstract class CleanToolWidget : MonoBehaviour
|
||||
{
|
||||
public abstract void SetToolDirtiness(float dirtiness);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95907fda6bb942a1865c6f1d9a6c1f91
|
||||
timeCreated: 1786025360
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Code.D.Cleaning.CleanTools;
|
||||
using Code.Infrastructure.UI;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.D.Cleaning.UI
|
||||
{
|
||||
public class CleaningPanel : UIPanel
|
||||
{
|
||||
[Inject]
|
||||
private void Construct(List<CleanTool> cleanTools)
|
||||
{
|
||||
Debug.Log("InjectingPanel");
|
||||
|
||||
foreach (var cleanTool in cleanTools) Debug.Log(cleanTool);
|
||||
}
|
||||
|
||||
public override UniTask Open(CancellationToken cts = default)
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public override UniTask Close(CancellationToken cts = default)
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f7be6d67e6944899ab2c3ae0255b58e
|
||||
timeCreated: 1786025297
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Code.D.Cleaning.CleanTools;
|
||||
using R3;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Code.D.Cleaning.UI
|
||||
{
|
||||
public class TryapkaWidget : CleanToolWidget
|
||||
{
|
||||
[SerializeField] private Image toolImage;
|
||||
[SerializeField] private Color cleanToolColor;
|
||||
[SerializeField] private Color dirtyToolColor;
|
||||
|
||||
private IDisposable _disposable;
|
||||
|
||||
[Inject]
|
||||
private void Construct(List<CleanTool> cleanTools)
|
||||
{
|
||||
Debug.Log("InjectingWidget");
|
||||
|
||||
var tool = cleanTools.SingleOrDefault(x => x.ToolType == CleanToolType.Tryapka);
|
||||
|
||||
if (tool == null) return;
|
||||
|
||||
_disposable = tool.CurrentDirtiness
|
||||
.Subscribe(SetToolDirtiness);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
_disposable?.Dispose();
|
||||
}
|
||||
|
||||
public override void SetToolDirtiness(float dirtiness)
|
||||
{
|
||||
toolImage.color = Color.Lerp(cleanToolColor, dirtyToolColor, dirtiness);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cbf9cd4573e4544a67318da5d5fa072
|
||||
timeCreated: 1786025415
|
||||
Reference in new issue
Block a user