public CellGenerator(CellMapper cellMapper, Transform cellParent) { Assert.IsNotNull(cellMapper); Assert.IsNotNull(cellParent); this.cellMapper = cellMapper; this.cellParent = cellParent; }
public CellEventGenerator(CellMapper cellMapper) { this.cellMapper = cellMapper; Broker.Global.Receive <RequestBuildingMode>() .SubscribeWithState(this, (x, _this) => { _this.RecordId = x.BuildingCellEventRecord.Id; }) .AddTo(GameSystem.Instance); }
public Cell Initialize(int recordId, Vector2Int position, int group, CellType cellType, CellMapper cellMapper) { this.RecordId = recordId; this.Position = position; this.Group = group; this.Type = cellType; this.cellMapper = cellMapper; var constants = GameSystem.Instance.Constants.Cell; this.CachedTransform.position = new Vector3(position.x * (constants.Scale.x + constants.Interval), 0.0f, position.y * (constants.Scale.z + constants.Interval)); this.scalableObject.localScale = constants.Scale; this.boxCollider.center = new Vector3(0.0f, constants.Scale.y / 2.0f, 0.0f); this.boxCollider.size = constants.Scale; this.cellMapper.Add(this); return(this); }