Exemplo n.º 1
0
 /// <summary>
 /// Intializing in awake instead of start
 /// because ExpandCursor is instanciated from an update function that need the event registered immediatly
 /// </summary>
 public void Awake()
 {
     _stationExpanderControl = GetComponentInParent <StationExpanderControl>();
     _stationExpanderControl.CanExpandAtLocationChanged += OnCanExpandAtLocationChanged;
     _material       = _renderer.material;
     _material.color = _canBuildColor;
 }
Exemplo n.º 2
0
        private void Start()
        {
            _hexaGrid = new StationHexaGrid(GetComponentInChildren <Platform>());
            LevelManager.Instance.StationsManager.Register(this);

            _stationExpanderControl = GetComponent <StationExpanderControl>();

            _subCommands = new ObservableCollection <CommandViewModel>(
                _structureTypeList.List.Where(x => x.IsBuildable)
                .Select(x => new CommandViewModel(x.name, () => ExpandCommand(x))));

            // Command
            _expandCommand = new CommandViewModel("Expand", _subCommands);
            GetComponent <Selectable>().Commands = new[] { _expandCommand };
        }