virtual public void SetSkyCamText()
    {
        if (skyCamText && skyCamTextParent)
        {
            if (Fraction.ReduceFully(frac).denominator == 1)
            {
                skyCamText.Text = Fraction.ReduceFully(frac).numerator.ToString();
            }
            else
            {
                skyCamText.Text = Fraction.ReduceFully(frac).ToString();
            }
            skyCamText.Color = frac.numerator > 0 ? Color.black : Color.white;
            skyCamTextParent.GetComponent <Renderer>().material.color = frac.numerator > 0 ? new Color(1, 1, 1, 0.2f) : new Color(0, 0, 0, 0.2f);


            // reposition height of skycam indicator text for round and square number walls, so bricks do not overlap the indicator text.
            // for other walls such a spheres this is not needed.
            if (this.GetType() == typeof(NumberWallCreatorSquare))
            {
                NumberWallCreatorSquare nwcs = GetComponent <NumberWallCreatorSquare>();
                skyCamTextParent.localPosition = new Vector3(0, nwcs.wallY * brickScale + 1, 0);
            }
            else if (this.GetType() == typeof(NumberWallCreatorRound))
            {
                NumberWallCreatorRound nwr = GetComponent <NumberWallCreatorRound>();
                skyCamTextParent.localPosition = new Vector3(0, nwr.height * brickScale + 1, 0);
//				// commented Debug.Log("sky cam text parent:"+skyCamTextParent.localPosition.y);
            }
        }
    }
    void SetTextSkipMod()
    {
        textSkipMod = 0;         // f**k it
        return;

        if (this.GetType() == typeof(NumberWallCreatorSquare))
        {
            NumberWallCreatorSquare sq = GetComponent <NumberWallCreatorSquare>();
            if (sq.wallX * sq.wallY * sq.wallZ > 20)              // only skipmod if more than 20 bricks
            {
                if (sq.wallZ % 5 == 0 || sq.wallX % 5 == 0 || sq.wallY % 5 == 0)
                {
                    textSkipMod = 4;                                                                              //
                }
                else
                {
                    textSkipMod = 5;
                }
//				else  textSkipMod = 4;
                //				if (sq.wallZ % 3 == 0) textSkipMod = 4;
                // if z is 9 or 6, skip every 4 blocks
                // if z is
            }
        }
        else if (this.GetType() == typeof(NumberWallCreatorRound))
        {
            NumberWallCreatorRound ro = GetComponent <NumberWallCreatorRound>();
            int count = (int)(ro.degreesToComplete * ro.radius / brickScale / 60);
            if (count * ro.height > 20)
            {
                if (count % 5 != 0)
                {
                    textSkipMod = 5;
                }
                else
                {
                    textSkipMod = 4;
                }
            }
//			if (sq.wallX * sq.wallY * sq.wallZ > 100){ // only skipmod if more than 100 bricks
//				if (sq.wallZ % 2 == 0) textSkipMod = 3; //
//				else  textSkipMod = 4;
            //				if (sq.wallZ % 3 == 0) textSkipMod = 4;
            // if z is 9 or 6, skip every 4 blocks
            // if z is
//			}
        }
        else
        {
            textSkipMod = 4;
        }
    }
Exemple #3
0
    public override void CreateWall()
    {
//		Debug.Log("wall");
        List <int> targetPositions = new List <int>();

        if (isRollableWheel)
        {
            NumberWallCreatorRound.CreateRollableWall(
                transform.position,
                radius,
                degreesToComplete,
                brickScale,
                thickness,
                height,
                frac,
                transform);
            return;
        }
//		else {

        int count = (int)(degreesToComplete * radius / brickScale / 60);


        for (int i = 0; i < thickness * count * height; i++)
        {
//			#if UNITY_EDITOR
//			Debug.Log("ed");
//			MakeSingleBrick(i);
//			#else
//			Debug.Log("target:"+i);
            targetPositions.Add(i);
//			#endif
        }

        SetCreatedNumbersToTarget(targetPositions);

//		}
    }