FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionCustomizable Button in Unity3D {BryceCain25}

more_horiz
The top two integers will decide the position of the buttons,
The bottom two integers will decide length and width..
WaitFor is the ammount of seconds until it loads the level..
LevelToLoad is the level to load after button click, make sure the string name is the same
as the one you added in the build settings; File -> Build Settings

Code (In JavaScript, you can name it whatever);

Code:

var CustomGUIString : String;
var WaitFor : int;
var LevelToLoad : String;
var one_ : int; //position integer
var two_ : int; //position integer
var three_ : int; //size modifier
var four_ : int; //size modifier
function Start () {

}

function Update () {

}

function OnGUI () {
if (GUI.Button(Rect(one_,two_,three_,four_),CustomGUIString)) {
waitandload();
}
}

function waitandload () {
yield WaitForSeconds(WaitFor);
Application.LoadLevel(LevelToLoad);
}

_________________
-BryceCain25

descriptionRe: Customizable Button in Unity3D {BryceCain25}

more_horiz
Really nice Very Happy Thanks again BryceCain25! Very Happy

_________________
Game Developer
YouTube Channel: [You must be registered and logged in to see this link.]
Website: [You must be registered and logged in to see this link.]

descriptionRe: Customizable Button in Unity3D {BryceCain25}

more_horiz
[You must be registered and logged in to see this link.] wrote:
Really nice Very Happy Thanks again BryceCain25! Very Happy
Sure thing! If you can modify it, post another version! Very Happy

_________________
-BryceCain25
Permissions in this forum:
You cannot reply to topics in this forum