void firstGenerate() { actuall = InstantiateBlockSet(GetRandomSet(), firstSetDistance); next = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y + actuall.margin); earlier = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y - 200); }
void Start() { playerStartingPos = player.position; actuall = InstantiateBlockSet(GetRandomSet(), firstSetDistance - 200); next = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y + actuall.margin - 200); earlier = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y - 200); }
void generatenext() { if (earlier != null) { Destroy(earlier.gameObject); } earlier = actuall; actuall = next; next = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y + actuall.margin + generalMargin); }
public ConditionsMappingSetViewModel(BlocksSet blocksSet) { AddBlockCommand = new RelayCommand(() => AddBlock(null)); ConditionsBlocks = new ObservableCollection <ConditionsBlockViewModel>(); m_blocksSet = blocksSet; //init childs if (blocksSet.ConditionsBlocks.Count > 0) { foreach (var item in blocksSet.ConditionsBlocks) { AddBlock(item); } } else { //add first block AddBlock(null); } }
BlocksSet InstantiateBlockSet(BlocksSet set, float y) { return(Instantiate(set, new Vector3(0, y, 0), player.rotation)); }