public BlockBehaviour InstantiateWith(Block block, Transform parent) { BlockBehaviour behaviour = Instantiate(this, PositionToVector(block.Position), Quaternion.identity, parent); behaviour.block = block; return(behaviour); }
public void Awake() { instantiator = GetComponent <BlockInstantiator>(); groups = new List <BlockGroup>(); core = new CoreGroupBuilder(new Position(0, 0), GetComponent <Axis>(), groups) .ForEachBlock(block => { BlockBehaviour behaviour = instantiator.InstantiateBlock(block); if (block.Position.Equals(new Position(0, 0))) { config.follower.Follow(behaviour.gameObject); } }) .Build(); groups.Add(new SquareBuilder(new Position(0, -7), core) .ForEachBlock(block => instantiator.InstantiateBlock(block)) .Build()); heartbeat = new Heartbeat(config.heartbeat); }