26 lines
688 B
C#
26 lines
688 B
C#
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|