Beispiel #1
0
        // Unity functions
        void Awake()
        {
            if (Instance)
            {
                Debug.LogWarning($"RBTUnitSelector on '{gameObject.name}' was destroyed as there's already one attached on '{name}'");
                Destroy(this);
                return;
            }
            else
            {
                Instance = this;
            }

            if (!_material)
            {
                Debug.LogError("Please assign a material in the inspector");
            }

            if (_selectable == 0)
            {
                Debug.LogWarning($"Please assign layers to 'Selectable' on RBTUnitSelector attached to '{name}'");
            }

            if (!_selectableTeam)
            {
                Debug.LogWarning($"Please assign a team to 'Selectable Team' on RBTUnitSelector attached to '{name}'");
            }
        }
 public OnUnitsSelectedEvent(RBTUnitSelector sender, List <RBTUnit> units, Team team)
 {
     Sender        = sender;
     SelectedUnits = new List <RBTUnit>(units);
     Team          = team;
 }