mercredi 20 septembre 2017

Random.Range && NotRepeating elements

The main idea is the image below. Project image

Each object contains 16 letters, 8 lowercase letters and 8 uppercase letters as in the picture below. architecture image

all I've done is to have a random letter in each box. This script is attached to each box.

using EduUtils.GameUtil;
using EduUtils.Visual;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EduUtils.Events;

public class LetterSequence : MonoBehaviour
{
    public ObjectSequence letterSequence;
    Randomizer LetterRandom = new Randomizer(0, 15, true);
    void Start()
    {
        int letterIndex = LetterRandom.getRandom();
        letterSequence.setCurrentChildIndex(letterIndex);
    }
}

I want in 8 random boxes to see big letters and in the other 8 boxes the small letters. How do I do this?




Aucun commentaire:

Enregistrer un commentaire