Progress observer

This commit is contained in:
Ader Alisma 01 2025-06-01 18:31:39 -04:00
parent 9b7778ee6a
commit d14b00fe10
3 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeselectManager<T> : MonoBehaviour where T : SingletonBehaviour<T>
{
public static T Instance
{
get;
private set;
}
protected virtual void Awake()
{
if (!Instance) Instance = this as T;
else Destroy(this);
}
private void Update()
{
if (Input.GetMouseButton(0))
{
// Verif liste si click sur un enfant d'AllyUpgrade
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4c63e60a445cf4549999d898b25ab0ea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,7 +13,14 @@ public class DeselectedAction : MonoBehaviour, IDeselectHandler
public void OnDeselect(BaseEventData eventData) public void OnDeselect(BaseEventData eventData)
{ {
GameObject selectedObject = EventSystem.current.currentSelectedGameObject;
Debug.Log("DeselectedAction called on: " + selectedObject?.name);
if (selectedObject != null && selectedObject.transform.IsChildOf(_allyUpgrade.transform))
{
//N'interrompt pas l'upgrade
return;
}
Debug.Log("Called to deselect"); Debug.Log("Called to deselect");
Destroy(_allyUpgrade); //Destroy(_allyUpgrade);
} }
} }