- Home /
This question was
closed Dec 03, 2014 at 07:15 PM by
Landern for the following reason:
Not specific.
Question by
Mysorekar Gamers · Dec 03, 2014 at 07:15 PM ·
Global name space error c#
using UnityEngine;
using System.Collections;
****"public class BuildingManager : MonoBehaviour {"****
public GameObject[] buildings;
private BuildingPlacement buildingPlacement;
// Use this for initialization
void Start () {
buildingPlacement = GetComponent<BuildingPlacement>();
}
// Update is called once per frame
void Update () {
}
void OnGUI() {
if (GUI.Button (new Rect (Screen.width / 20, Screen.height / 15 + Screen.height / 12 * i, 100, 30), "General" ) {
for (int i = 0; i <buildings.Length; i ++) {
if (GUI.Button (new Rect (Screen.width / 20, Screen.height / 15 + Screen.height / 12 * i, 100, 30), buildings [i].name)) {
buildingPlacement.SetItem (buildings [i]);
}
}
}
}
}
Comment