示例#1
0
    // Use this for initialization
    void Start()
    {
        preferences = preferencesObject.GetComponent <Preferences>();

        controls                  = controlsObject.GetComponent <controls>();
        modelTile                 = modelObject.GetComponent <ModelTile>();
        settingsPrefab            = GameObject.Find("settings");
        isShowing                 = false;
        mask                      = Instantiate(Resources.Load("misc/mask"), new Vector3(0, 0, -1.5f), Quaternion.identity) as GameObject;
        mask.transform.localScale = new Vector3(0, 0, 0);

        //TilesInit
        dDownTiles.onValueChanged.AddListener(delegate { onDropdownTilesValueChanged(); });

        List <GameObject> tiles = new List <GameObject>(Resources.LoadAll <GameObject>("tiles"));

        tilesNames = new List <string>(tiles.Select(x => x.name));
        dDownTiles.ClearOptions();
        dDownTiles.AddOptions(tilesNames);

        //Quality Init
        dDownQuality.onValueChanged.AddListener(delegate { onDropdownQualityValueChanged(); });
        qualityLevels = Enum.GetNames(typeof(QualityLevel));
        qualityList   = new List <string>();
        qualityList.AddRange(qualityLevels);
        dDownQuality.ClearOptions();
        dDownQuality.AddOptions(qualityList);
        QualitySettings.SetQualityLevel(5);
        //FacesInit
        dDownFaces.onValueChanged.AddListener(delegate { onDropDownFacesValueChanged(); });
        Sprite[] smth = Resources.LoadAll <Sprite>("faces");
        //THIS ONE IS FOR YOU HARAMBE APPRECIATE YA GOD BLESS
        spriteNames = new List <string>(smth.Where(x => x.name.Contains("_0")).Select(y => y.name.TrimEnd(new char[] { '_', '0' })));
        dDownFaces.ClearOptions();
        dDownFaces.AddOptions(spriteNames);
        controls.Initiate();
        modelTile.Create(dDownTiles.options[preferences.GetSavedTiles()].text, dDownFaces.options[preferences.GetSavedFaces()].text);
    }
示例#2
0
    public void Apply()
    {
        string choice = "";

        switch (dDownFaces.value)
        {
        case 0:
            choice = "Fruits(B&W)";
            break;

        case 1:
            choice = "Fruits(Oil)";
            break;

        case 2:
            choice = "Sunny";
            break;

        default:
            break;
        }
        PlayerPrefs.SetString("savedFaces", choice);
        controls.Initiate();
    }