1
This commit is contained in:
26
Unity/Scripts/Selection/Selectable.cs
Normal file
26
Unity/Scripts/Selection/Selectable.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
namespace BITKit
|
||||
{
|
||||
public class Selectable : MonoBehaviour, ISelectable
|
||||
{
|
||||
public Transform GetTransform() => transform;
|
||||
ISelectableComponent[] components;
|
||||
void Start()
|
||||
{
|
||||
components = GetComponentsInChildren<ISelectableComponent>(true);
|
||||
foreach (var x in components)
|
||||
{
|
||||
x.SetSelectionState(0);
|
||||
}
|
||||
}
|
||||
public void SetSelectionState(SelectionState state)
|
||||
{
|
||||
foreach (var x in components)
|
||||
{
|
||||
x.SetSelectionState(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user