Exemple #1
0
    void firstGenerate()
    {
        actuall = InstantiateBlockSet(GetRandomSet(), firstSetDistance);

        next = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y + actuall.margin);

        earlier = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y - 200);
    }
Exemple #2
0
    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);
    }
Exemple #3
0
 void generatenext()
 {
     if (earlier != null)
     {
         Destroy(earlier.gameObject);
     }
     earlier = actuall;
     actuall = next;
     next    = InstantiateBlockSet(GetRandomSet(), actuall.transform.position.y + actuall.margin + generalMargin);
 }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
 BlocksSet InstantiateBlockSet(BlocksSet set, float y)
 {
     return(Instantiate(set, new Vector3(0, y, 0), player.rotation));
 }