Exemplo n.º 1
0
    private SquareBehaviour GenerateSquare()
    {
        SquareBehaviour result = Instantiate <SquareBehaviour>(prefabs[prefabIndex++]);

        result.transform.SetParent(this.transform);
        result.CommanderEnteredEvent += CommanderEnteredHandler;
        result.LinkToPrevious(connectSquare);
        BuildFollowers(result.transform);
        return(result);
    }
Exemplo n.º 2
0
    private void Start()
    {
        levels = new Queue <SquareBehaviour>();
        //connectSquare = Instantiate<SquareBehaviour>(prefabs[Random.Range(0, prefabs.Length)]);
        //connectSquare.transform.position = Vector3.zero;
        SquareBehaviour lastSquare = connectSquare;

        for (int i = 0; i < fixedSequence.Length; ++i)
        {
            var             t = fixedSequence[i];
            SquareBehaviour n = Instantiate <SquareBehaviour>(t);
            n.transform.SetParent(this.transform);
            n.LinkToPrevious(lastSquare);
            BuildFollowers(n.transform, ((float)fixedSequence.Length) / i, i);
            levels.Enqueue(n);
            lastSquare = n;
        }
    }