private void Awake() { StatsMath = new StatsMath(); SpaceShip = new SpaceShip(); CharacterPool = new CharacterPool(); StartConditions = new StartConditions(); ButtonModel = new ButtonModel(); Scenario = new Scenario(); References = FindObjectOfType <References>(); }
public StatsMath() { characterPool = Models.CharacterPool; coefficientsGO = GameObject.Find("Coefficients"); coefficients = coefficientsGO.GetComponent <Coefficients>(); if (coefficients == null) { Debug.Log("Coefs == null"); } }
void Start() { shipController = FindObjectOfType <ShipController>(); statsMath = Models.StatsMath; pool = Models.CharacterPool; startConditions = Models.StartConditions; AddAllChildren(); SetStartPeopleCount(); CharInListView.OnCharClicked += ViewChar; Dragable.OnDragEvent += OnDrag; Droppable.OnDropEvent += OnDrop; }
void Start() { layout = GetComponent <GridLayoutGroup>(); rect = GetComponent <RectTransform>(); pool = Models.CharacterPool; pool.Characters.ObserveAdd() .Subscribe(x => AddToView(x.Value)) .AddTo(this); pool.Characters.ObserveRemove() .Subscribe(x => RemoveFromView(x.Value.Id)) .AddTo(this); PoolController.OnSendChar += UpdateBlockView; }