ObjectList.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    void Start()
    {
        assetManager = GameObject.Find ("AssetManager").GetComponent ("AssetManager") as AssetManager;
        parameterList = GameObject.Find ("ParameterList").GetComponent ("ParameterList") as ParameterList;

        foreach (KeyValuePair<string, GameObject> kv in assetManager.prefabs) {
            objects.Add(kv.Key);
        }

        listItems = objects.ToArray ();

        bgRect = new Rect (bgLeft, bgTop, bgWidth, bgHeight);

        //left and right side Add button
        leftAddRect = new Rect(bgLeft, bgTop+bgHeight+Screen.height/48, bgWidth, 25);
        rightAddRect = new Rect (19*bgLeft, bgTop + bgHeight + Screen.height / 48, bgWidth, 25);
    }

Usage Example

Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        ObjectList.Start();


        if (clickVolume < 0.0f)
        {
            clickVolume = 0.0f;
        }
        if (clickVolume > 1.0f)
        {
            clickVolume = 1.0f;
        }
        List <AudioClip> sounds  = new List <AudioClip>();
        List <float>     volumes = new List <float>();

        sounds.Add(clickSound);
        volumes.Add(clickVolume);
        audioElement = new AudioElement(sounds, volumes, "NewGame", null);

        comboBoxList = new GUIContent[ObjectList.racesList.Count];
        for (int i = 0; i < ObjectList.racesList.Count; i++)
        {
            comboBoxList[i] = new GUIContent(ObjectList.racesList[i].nameSpec);
        }

        listStyle.normal.textColor     = Color.white;
        listStyle.onHover.background   =
            listStyle.hover.background = new Texture2D(2, 2);

        playerInstance = new GameObject();
        playerInstance.AddComponent <EmpireController>();
    }
All Usage Examples Of ObjectList::Start