Hi all…
hoping someone can help me with a few problems im having... i have written a c# script for a pop up window in game, this will be used for an online store when completed... the problems i
m having is making the window pop up when a button is pressed say F1…
also how do i link the GUI buttons in the script to open diffrent pages… so i have a button for armours, potions, weapons etc., when someone clicks on them it opens a list of said items, that can then be bought through PAY PAL…
Any way first things first getting the window to open on key press…
Here is the script so far…
using UnityEngine;
using System.Collections;
public class DKstore : MonoBehaviour {
public GUISkin mySkin;
public Rect windowRect = new Rect(350, 75, 746, 486);
void Update () {
if(Input.GetButtonDown("left ctrl")) {
}
}
void OnGUI() {
GUI.skin = mySkin;
windowRect = GUI.Window(500, windowRect, DoMyWindow, "Destiny Knight Store");
}
void DoMyWindow(int windowID) {
GUI.Button(new Rect(40, 80, 150, 130), "Buy Membership");
GUI.Button(new Rect(40, 200, 150, 30), "Armour");
GUI.Button(new Rect(40, 230, 150, 30), "Potions");
GUI.Button(new Rect(40, 260, 150, 30), "Weapons");
GUI.Button(new Rect(40, 290, 150, 30), "Enchantments");
GUI.Button(new Rect(40, 320, 150, 30), "Gold");
GUI.Button(new Rect(200, 200, 500, 30), "Store Inventory");
GUI.Button(new Rect(200, 80, 500, 130), "Triple XP View Details");
GUI.Button(new Rect(200, 220, 150, 130), "Armours");
GUI.Button(new Rect(200, 320, 150, 30), "View All Item");
GUI.Button(new Rect(375, 220, 150, 130), "Potions");
GUI.Button(new Rect(375, 320, 150, 30), "View All Items");
GUI.Button(new Rect(550, 220, 150, 130), "Currency");
GUI.Button(new Rect(550, 320, 150, 30), "View All Items");
GUI.Button(new Rect(200, 360, 500, 30), "Featured Deals");
GUI.DragWindow();
}
}
Any help would be appreciated…