// Use this for initialization void Start() { //if the static AbilityPanelManager instance is not null and isn't this object, destroy itself if (instance != null && instance != this) { Destroy(this); return; } //set the static instance instance = this; //create the array of panes panes = new AbilityPane[AbilityList.MAX_SIZE]; //index of the pane in the actual game scene int paneNum; //initialize array of panes for (int i = 0; i < AbilityList.MAX_SIZE; ++i) { paneNum = i + 1; panes[i] = GameObject.Find("Ability " + paneNum + " Pane").GetComponent <AbilityPane>(); } }
/// <summary> /// Set the ability panes for the currently selected object /// </summary> /// <param name="list">The list of abilities associated with the object</param> public void SetAbilityPanes(AbilityList list) { AbilityPanelManager.GetInstance().SetPanes(list); }
void Awake() { instance = this; }