Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SpriteTextTools.cs
- //@MenuItem ("ezG-Wiz/UnPreFab a PreFab")
- //static function UnPreFabaPreFab() {
- // for (var g : GameObject in Selection.gameObjects) {
- //// var thisUIListItemContainer : UIListItemContainer = g.GetComponent(UIListItemContainer);
- // if (thisUIListItemContainer) {
- // var thisSpriteTextObject : SpriteText = thisUIListItemContainer.GetComponentInChildren(SpriteText);
- // if (thisSpriteTextObject) {
- // thisSpriteTextObject.Text = thisUIListItemContainer.Text;
- // Debug.Log ("YUP");
- // }
- // }
- // }
- //}
- @MenuItem ("ezG-Wiz/Reset UIListItemContainer Text")
- static function ResetUIListItemContainerText() {
- for (var g : GameObject in Selection.gameObjects) {
- var thisUIListItemContainer : UIListItemContainer = g.GetComponent(UIListItemContainer);
- if (thisUIListItemContainer) {
- var thisSpriteTextObject : SpriteText = thisUIListItemContainer.GetComponentInChildren(SpriteText);
- if (thisSpriteTextObject) {
- thisSpriteTextObject.Text = thisUIListItemContainer.Text;
- Debug.Log ("YUP");
- }
- }
- }
- }
- @MenuItem ("ezG-Wiz/Reset UIButton Text")
- static function ResetUIButtonText() {
- for (var g : GameObject in Selection.gameObjects) {
- var thisUIButton : UIButton = g.GetComponent(UIButton);
- if (thisUIButton) {
- var thisSpriteTextObject : SpriteText = thisUIButton.GetComponentInChildren(SpriteText);
- if (thisSpriteTextObject) {
- thisSpriteTextObject.Text = thisUIButton.Text;
- }
- }
- }
- }
- @MenuItem ("ezG-Wiz/Set Box Colliders")
- static function SetBoxColliders() {
- for (var g : GameObject in Selection.gameObjects) {
- var thisUIButton : UIButton = g.GetComponent(UIButton);
- if (thisUIButton) {
- var thisBoxCollider: BoxCollider = thisUIButton.GetComponentInChildren(BoxCollider);
- if (thisBoxCollider) {
- thisBoxCollider.size = Vector3 (1000,650,0); // SET BY HAND
- thisBoxCollider.center = Vector3 (0,0,0); // SET BY HAND
- }
- }
- }
- }
- @MenuItem ("ezG-Wiz/Create Null Box Colliders")
- static function CreateNullBoxColliders() {
- for (var g : GameObject in Selection.gameObjects) {
- // var thisUIButton : UIButton = g.GetComponent(UIButton);
- // if (thisUIButton) {
- // var aBoxCollider : BoxCollider = g.GetComponent(BoxCollider);
- // if (!aBoxCollider) {
- var thisBoxCollider: BoxCollider = g.AddComponent(BoxCollider);
- thisBoxCollider.size = Vector3.zero;
- thisBoxCollider.center = Vector3.zero;
- // } else {
- // Debug.Log ("There is already a box collider on " + g.name + "!");
- // }
- // }
- }
- }
- @MenuItem ("ezG-Wiz/Null-ify Script With Method")
- static function NullifyScriptWithMethod() {
- for (var g : GameObject in Selection.gameObjects) {
- var thisUIButton : UIButton = g.GetComponent(UIButton);
- if (thisUIButton) {
- thisUIButton.scriptWithMethodToInvoke = null;
- }
- }
- }
- @MenuItem ("ezG-Wiz/Set Method To Invoke")
- static function SetMethodToInvoke() {
- var trackNumber : int = 0;
- var objects : GameObject[] = Selection.gameObjects;
- var names : String[] = new String[objects.Length];
- for (var i : int = 0; i < objects.Length; i++) {
- names[i] = objects[i].name;
- }
- System.Array.Sort(names, objects);
- for (var g : GameObject in objects) {
- var thisUIButton : UIButton = g.GetComponent(UIButton);
- if (thisUIButton) {
- thisUIButton.methodToInvoke = "PlayTrack0" + trackNumber;
- }
- trackNumber ++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement