Exemple #1
0
    public FaceInfo Randomise(Simple2x2 pos, Simple2x2 rot, Simple2x2 sc)
    {
        RandomIndex();
        FaceInfo final = new FaceInfo(Index, Colour);

        Vector3 p = new Vector3(pos.RandX(), 0.0F, pos.RandY());

        final._Position = p;

        Vector3 r = new Vector3(0.0F, 0.0F, rot.RandX());

        final._Rotation = r;

        Vector2 s = Utility.RandomMatrixPoint(sc);

        final._Scale = Vector3.one + new Vector3(s.x, s.y, 0.0F);

        return(final);
    }
Exemple #2
0
    public FaceInfo Randomise(bool gender, Simple2x2 pos, Simple2x2 rot, Simple2x2 sc)
    {
        int      Index = gender ? Random.Range(0, Male.Length) : Random.Range(0, Female.Length);
        FaceInfo final = new FaceInfo(Index, Colour);

        final.Obj = gender ? Male[Index]: Female[Index];

        Vector3 p = new Vector3(pos.RandX(), 0.0F, pos.RandY());

        final._Position = p;

        Vector3 r = new Vector3(0.0F, 0.0F, rot.RandX());

        final._Rotation = r;

        Vector2 s = Utility.RandomMatrixPoint(sc);

        final._Scale = Vector3.one + new Vector3(s.x, s.y, 0.0F);
        return(final);
    }
Exemple #3
0
 public static Vector2 RandomMatrixPoint(Simple2x2 s)
 {
     return(new Vector2(UnityEngine.Random.Range(s.min.x, s.max.x),
                        UnityEngine.Random.Range(s.min.y, s.max.y)));
 }