-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlueLightGUI.js
More file actions
104 lines (86 loc) · 3.09 KB
/
Copy pathBlueLightGUI.js
File metadata and controls
104 lines (86 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
private var leafOffset;
private var frameOffset;
private var skullOffset;
private var RibbonOffsetX;
private var FrameOffsetX;
private var SkullOffsetX;
private var RibbonOffsetY;
private var FrameOffsetY;
private var SkullOffsetY;
private var WSwaxOffsetX;
private var WSwaxOffsetY;
private var WSribbonOffsetX;
private var WSribbonOffsetY;
private var spikeCount;
// This script will only work with the Necromancer skin
var mySkin : GUISkin;
//if you're using the spikes you'll need to find sizes that work well with them these are a few...
private var windowRect3 = Rect (Screen.width-800, Screen.height-500, 300, 200);
private var scrollPosition : Vector2;
private var HroizSliderValue = 0.5;
private var VertSliderValue = 0.5;
private var ToggleBTN = false;
public var player : GameObject;
public var lightpole : GameObject;
public var distance : float;
function AddSpikes(winX){
spikeCount = Mathf.Floor(winX - 152)/22;
GUILayout.BeginHorizontal();
GUILayout.Label ("", "SpikeLeft");//-------------------------------- custom
for (i = 0; i < spikeCount; i++)
{
GUILayout.Label ("", "SpikeMid");//-------------------------------- custom
}
GUILayout.Label ("", "SpikeRight");//-------------------------------- custom
GUILayout.EndHorizontal();
}
function FancyTop(topX){
leafOffset = (topX/2)-64;
frameOffset = (topX/2)-27;
skullOffset = (topX/2)-20;
GUI.Label(new Rect(leafOffset, 18, 0, 0), "", "GoldLeaf");//-------------------------------- custom
GUI.Label(new Rect(frameOffset, 3, 0, 0), "", "IconFrame");//-------------------------------- custom
GUI.Label(new Rect(skullOffset, 12, 0, 0), "", "Skull");//-------------------------------- custom
}
function WaxSeal(x,y){
WSwaxOffsetX = x - 120;
WSwaxOffsetY = y - 115;
WSribbonOffsetX = x - 114;
WSribbonOffsetY = y - 83;
GUI.Label(new Rect(WSribbonOffsetX, WSribbonOffsetY, 0, 0), "", "RibbonBlue");//-------------------------------- custom
GUI.Label(new Rect(WSwaxOffsetX, WSwaxOffsetY, 0, 0), "", "WaxSeal");//-------------------------------- custom
}
function DeathBadge(x,y){
RibbonOffsetX = x;
FrameOffsetX = x+3;
SkullOffsetX = x+10;
RibbonOffsetY = y+22;
FrameOffsetY = y;
SkullOffsetY = y+9;
GUI.Label(new Rect(RibbonOffsetX, RibbonOffsetY, 0, 0), "", "RibbonRed");//-------------------------------- custom
GUI.Label(new Rect(FrameOffsetX, FrameOffsetY, 0, 0), "", "IconFrame");//-------------------------------- custom
GUI.Label(new Rect(SkullOffsetX, SkullOffsetY, 0, 0), "", "Skull");//-------------------------------- custom
}
//bringing it all together
function BlueLight () {
// use the spike function to add the spikes
AddSpikes(windowRect3.width);
GUILayout.Space(8);
GUILayout.BeginVertical();
GUILayout.Label("Press E To Heal");
GUILayout.Label ("", "Divider");
GUILayout.EndVertical();
}
function OnGUI (){
GUI.skin = mySkin;
if(distance < 4){
windowRect3 = GUI.Window (3, windowRect3, BlueLight, "");
GUI.BeginGroup (Rect (0,0,100,100));
GUI.EndGroup ();
}
}
function Start(){
}
function Update(){
distance = Vector3.Distance(player.transform.position, lightpole.transform.position);
}