Skip to content

Smart Tools

User created LBs

Smart Tools

Postby Viziopleasure » 14 Apr 2011, 12:53

Attachments
Antares Universe - Smart Tools 1.0.unitypackage
(14.18 KiB) Downloaded 388 times
Last edited by Viziopleasure on 10 May 2011, 16:19, edited 15 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Splash-Screen

Postby Viziopleasure » 14 Apr 2011, 12:54

:!: [1] Splash-Screen Scene:

Image

[How To Use]:
º With Antares Universe and Smart Tools imported into your project, add a Graph to a camera in an empty scene.
º In Universe's explorer go to Smart Blocks > Smart Tools > Automation > Splash Screen.
º Click it and drag to your working space. And Thats it! Now you just select the image you want your splash-screen to draw and customize what you want:


(Level to Load): Enter the name of the level you want to load when the splash-screen is finished. The level must be in Unity's Build Settings to work, check that in File > Build Settings....
(Splash Image): Select the texture you want to use for your splash-screen.
(Image's Scale Mode): Configure your image's stretching mode. Try them to see witch one is the best for your image.
(Fading Color): Choose the color you want the screen to fade on when the splash-screen comes in and out. If your image don't cover up all the screen, use the same color of your camera's background.

[Result]:
Image

Your image shows up and stays up until your next level is fully loaded, this is great for web players and slow devices.
After your level is loaded, your splash-screen fades out to the color you've chosen and then starts the level you want to.
No spaghetti! Easy or not?! Have fun! ;)


[Known Issues]:
º The fading function won't work until you assign a value in the color-pick box. Assign a color even if it's the same default black color.
Last edited by Viziopleasure on 10 May 2011, 16:19, edited 7 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Main Menu Template

Postby Viziopleasure » 19 Apr 2011, 00:24

:!: [2] Simple Main Menu Template:

Image
ImageImage

[How To Use]:
º With Antares Universe and Smart Tools imported into your project, add a Graph to a camera in an empty scene.
º In Universe's explorer go to Smart Blocks > Smart Tools > Automation > Main Menu.
º Click it and drag to your working space. Than you just configures your buttons and background image:


[Note]: This SB recognizes items you don't want to use in your scene. For example, if you don't want to use the "Lore" Button in your menu, just disable the box right before it's name.
[Changes Note]:
º Changed the Scene loading method to load a "Loading Screen" instead of loading the Scene directly.
º Added Warning Box when erasing existing saved progress.

(Auto-Layout): If you check this box, your menu will build in an auto-controlled behavior. All buttons have automatic size and position and they will never stretch, it doesn't matter what aspect ratio your screen is.
(Key of Saved Level): Inform to the menu what is the PlayerPrefs Key you want to use to save your game's level progress. If the key already exists and a level is available, Load Game Button will be unlocked.
(Loading-Screen): Indicate here the name of the Scene that uses the Load-Screen Smart Block. The Menu will load this scene that tracks the loading time for the scene saved in Key of Saved Level.
(Lore URL): The Lore Button let the player to open a webpage for more detail on the game, like history, guides, etc. You can use it to open any URL you may want tho.

(Background): The background image for your menu. If you don't want to use any image, disable this field, else it will shoot runtime errors when searching for the texture.
(Start Game Caption): The text for your Start Game Button. If you want to use just texture, leave it empty or disable it.
(Start Game Button): This button loads the first level of your game given by the Game's First Level string.
(Load Game Caption): The text for your Load Game Button. If you want to use just texture, leave it empty or disable it.
(Load Game Button): When there's a saved level in your PlayerPrefs key, given by Key of Saved Level, this button will be unlocked for the player to load the previous game session.
(Lore Caption): The text for your Lore Button. If you want to use just texture, leave it empty or disable it.
(Lore Button): Opens in web-browser the URL given by Lore URL.
(Settings Caption): The text for your Settings Button. If you want to use just texture, leave it empty or disable it.
(Settings Button): Opens a simple sub-menu to edit and save video quality and turn audio on or off.

(Start Game Rect): If you don't want to use Auto-Layout, use this to personalize your Start Game Button. Your button won't be relative to screen-space.
(Load Game Rect): If you don't want to use Auto-Layout, use this to personalize your Load Game Button. Your button won't be relative to screen-space.
(Lore Rect): If you don't want to use Auto-Layout, use this to personalize your Lore Game Button. Your button won't be relative to screen-space.
(Settings Rect): If you don't want to use Auto-Layout, use this to personalize your Settings Game Button. Your button won't be relative to screen-space.

(Key to Save Quality): The name of your PlayerPrefs Key to store graphic quality option. Unity can remember this data, but you can use this as an option.
(Simple Quality Caption): The text for the button that appears in Settings Menu when your game uses this quality level or lower.
(Simple Quality Button): This button appears in Settings Menu when your game uses this quality level or lower.
(Good Quality Caption): The text for the button that appears in Settings Menu when your game uses this quality level.
(Good Quality Button): This button appears in Settings Menu when your game uses this quality level.
(HD Quality Caption): The text for the button that appears in Settings Menu when your game uses this quality level(Beautiful) or higher.
(HD Quality Button): This button appears in Settings Menu when your game uses this quality level(Beautiful) or higher.
(Quality Box): The box that appears side by side with the Quality Button.
(Quality Box Rect): Personalizes the box when not using Auto-Layout.
(Quality Button Rect): Personalizes the button when not using Auto-Layout.

(Key for Audio Option): The name of your PlayerPrefs Key to store audio option(on/off).
(Audio Option Caption): The text for the button that appears in Settings Menu indicating audio on or off.
(Audio On): This button appears in Settings Menu when your game's audio is on.
(Audio Off): This button appears in Settings Menu when your game's audio is off.
(Audio Box): The box that appears side by side with the Audio Button.
(Audio Box Rect): Personalizes the box when not using Auto-Layout.
(Audio Button Rect): Personalizes the button when not using Auto-Layout.

(Ok Button Caption): The text for the OK button in Settings Menu.
(Ok Button): This button apply the selected options and save them to PlayerPrefs with the earlier given Keys.
(Ok Button Rect): Personalizes the button when not using Auto-Layout.

(Warning Ok Caption): The text for the OK button in the warning sub-menu.
(Warning Ok Button): This button erases previous recorded game data if player confirms by clicking/pressing it.
(Warning Ok Rect): Personalizes the button when not using Auto-Layout.
(Warning Cancel Caption): The text for the Cancel button in the warning sub-menu.
(Warning Cancel Button): This button cancels the erase action and returns to main menu.
(Warning Cancel Rect): Personalizes the button when not using Auto-Layout.
(Warning Box): A background box for text message or text rendered in texture to warn the player about loosing data.
(Warning Cancel Rect): Personalizes the button when not using Auto-Layout.

[Note]: If you are not familiar on how to use GUIStyles in Universe, just notice you need to click the Show Style Parameters dropdown them click Create Empty and your Button will be assigned that Style.


[Result]:
ImageImage
Last edited by Viziopleasure on 02 May 2011, 16:15, edited 10 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Loading-Screen Template

Postby Viziopleasure » 19 Apr 2011, 00:25

:!: [3] Simple Loading-Screen Template:

Image

[How To Use]:
º With Antares Universe and Smart Tools imported into your project, add a Graph to a camera in an empty scene.
º In Universe's explorer go to Smart Blocks > Smart Tools > Automation > Loading Screen.
º Click it and drag to your working space. Than you just configures your buttons and background image:


(Game's First Level): The SB will try to load a recorded level in your Key of Saved Level from Main Menu. If there's no game progress recorded, it will load the scene given in this field.
(Key of Saved Level): Inform to the loading-screen what is the name of the PlayerPrefs Key you use to save your game's progress. Must be the same value of your Main Menu's Key.

(Splash Image): The background image for your loading scene.
(Image's Scale Mode): Adjust the stretching factor of your background image.
(Fading Color): The color the screen fades in and out.

(Loading Bar): If enabled this displays a progress bar using the given GUIStyle. A simple bar texture in the normal > background value is good to go.


[Result]:
Image


[Known Issues]:
º The fading function won't work until you assign a value in the color-pick box. Assign a color even if it's the same default black color.
Last edited by Viziopleasure on 26 Apr 2011, 18:10, edited 7 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Smart Tools

Postby Neodrop » 19 Apr 2011, 01:43

May be would be better to divide this huge SB to some parts with equal parent name ("Main Menu")?
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Smart Tools

Postby Viziopleasure » 19 Apr 2011, 01:46

Neodrop wrote:May be would be better to divide this huge SB to some parts with equal parent name ("Main Menu")?


Yes, it is very big. But for an eclectic creation it's just better use blocks Universe provides already. This is just for people who really really don't want to mess around with graphs.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Smart Tools

Postby Neodrop » 19 Apr 2011, 01:48

Fine. It's your baby ;)
Or your Galaxy inside Universe.
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Joystick HuD (Mobile)

Postby Viziopleasure » 19 Apr 2011, 01:50

:!: [4] Joystick HuD:

Image


[How To Use]:
º With Antares Universe and Smart Tools imported into your project, add a Graph to your Player.
º In Universe's explorer go to Smart Blocks > Smart Tools > HuD > (HuD) >> Joystick.
º Click it and drag to your working space. Before you proceed, in Unity's main menu go to GameObject > Create Other > GUI Texture. Configure your texture; Now the Smart Block is ready to go:


(Joystick Graphics): Drag&drop in this field the GUI Texture you created earlier. Your Joystick will use the texture as visual representation.
(Is Touch-Pad): If you set this to true, your Joystick will behave as a touch-button not a Joystick. Useful for HuD Buttons.

(Control Position): This output sends coordinates based on the GUI Texture position in screen relative to the Joystick origins. This is used by Joystick Controls to move a game-object.
(Finger Down): This checks if a finger is over the Joystick HuD. If there's a finger pressing it, it outputs "true" else outputs "false".
(Tap Count): This keeps track of how many times this HuD was pressed consecutively. Useful to check tap-count based conditions when in Touch-Pad mode.


[Result]:
Image
Last edited by Viziopleasure on 26 Apr 2011, 20:55, edited 5 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Joystick Controls (Mobile)

Postby Viziopleasure » 19 Apr 2011, 01:51

:!: [5] Joystick HuD:
[Note]: This is a Smart Block reproducing Unity's mobile controls available within Standard Assets(Mobile).

Image


[How To Use]:
º With Antares Universe and Smart Tools imported into your project, add a Graph to your Player.
º In Universe's explorer go to Smart Blocks > Smart Tools > Controls > (Camera Relative) >> Joystick.
º Click it and drag to your working space. Before you proceed, make sure you have two already configured Joysticks (HuD) (check out Smart Tool #4); When you have your HuD setup you're ready to go:


(Character Controller): Reference here the character controller attached to the player.
(Spawn Position): Reference here a Transform from any Game-Object. If this isn't empty the character will spawn from the location of this Transform when game starts.
(Camera Pivot): The Game-Object you use as a Pivot for your camera.
(Movement Joystick): Reference here the GUI Texture you use to represent the Joystick(HuD) that moves the character.
(Rotation Joystick): Reference here the GUI Texture you use to represent the Joystick(HuD) that rotates the camera.
(Rotation Speed): Setup the speed you want your camera to move on for X and Y axis.
(Movement Speed): This is the movement speed of your character. You can input here a dynamic value for walk/run variations.
(Jump Speed): This basically emulates gravity for your character when jumping. The character will jump when one of the Joysticks returns a double tap.
(In Air Multiplier): Affects the movement speed while jumping.
(Movement Joystick Position): Reference here a Control Position of a Joystick(HuD). This is what actually moves your character relative to the Joystick position.
(Rotation Joystick Position): Reference here a Control Position of a Joystick(HuD). This moves your camera around its pivot relative to the Joystick position.
(Finger Down): Reference here the output Finger Down from a Joystick(HuD). The controls uses this to know when there's a finger over a Joystick.
(Tap-Count): This keeps track of how many times the HuD was pressed consecutively. In the case of this Controller, the character will jump when the value is greater than one tap.

[Note]: This Smart Block requires you to setup your character's hierarchy like this:
Image

(Camera Relative Controls): Just an empty Game-Object. Used just to organize transforms.
(CameraPivot): Another empty Game-Object. The Smart Block uses this to perform an orbital translation of the camera.
(CameraOffset): A secondary pivot so you can adjust the position of your camera in Y axis.
(Camera): The Camera itself. The Smart Blocks needs its Transform information.
(Player): An empty Game-Object. This is your "logic" player where you setup layers, character infos, etc; And this is the object you need to attach the Universe's Graph you use the Joystick too.
(ReplaceWithRealCharacter): Any object that could be replaced with the finished graphical character with textures, animations, etc.


[Result]:
Image
Last edited by Viziopleasure on 26 Apr 2011, 20:54, edited 2 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Animated GUI-Text

Postby Viziopleasure » 26 Apr 2011, 20:50

:!: [6] Animated GUI-Text:
This Smart Block is useful for a ton of text based actions like dialog boxes, character's talks, credits screen, etc. It does not use OnGUI() functions.

Image


[How To Use]:
º With Antares Universe and Smart Tools imported into your project, add a Graph to a Game Object.
º In Universe's explorer go to Smart Blocks > Smart Tools > HuD > (GUI) >> Animated Text.
º Click it and drag to your working space.

[Notes]:
º This Smart Block extensively uses GUI-Text and GUI-Texture properties, if you're not familiar with those, please access Unity's GUI-Text and GUI-Texture manuals.
º This Smart Block automatically creates a GUI-Text object when running/enabled:
Image

[Changes Note]:
º Removed Pixel Offset parameter because of redundant functionality.
º Added Closing Icon reference.
º Added Talker Name reference.
º Added Talker Avatar reference.
º Added Drawing Order parameter.
º Added Wait Mouse to Disable parameter.
º Added Fade on Enable parameter.
º Added Fade on Disable parameter.
º Added Enable Input Trigger.
º Added Disable Input Trigger.
º Added While Finished Output Trigger.
º Added Speed Boost property.


(Enabled): If "true" the text is displayed and animated else nothing is drawn to the screen.
(Text Rows): For simplified control and better organization you enter your text here line by line. To create a new text click Show Array Parameters than click Create New Array and Add Element.
(Material): If you want, you can render the text with a custom material to change font color, opacity, etc. The material must use GUI/Text Shader and texture must be the same of your Font to work properly.
(Font): You can specify a custom Font. If you don't, Unity will render the text with standard Arial font.
(Anchor): The anchor of the text.
(Alignment): The alignment of the text.
(Drawing Order): The Z position of transform. This controls the level in screen your text and its background appears on screen. Default is zero.
(Position): From zero to 1.0 this represents the local in screen your text is drawn to. Zero is the left bottom corner of the screen.
(Line Spacing): The size of space between each line of text. This is multiplied with the line spacing defined in the font.
(Tab Size): The tab width. This is multiplied with the tab width defined in the font.
(Animation Interval): This is the time between new letters appears on screen. The higher the value the longer will take to a new letter popup.
(Background): This specifies an uniform text to be drawn as background for the text.
(Background Size): From zero to 1.0 this represents the size of the background texture. 1.0 is the size of screen's height/width.
(Self-Update): If "true" the Smart Block won't need to be connected to an Update Logic Block or looping branch. It will automatically loop.
(Closing Icon): References a GUI-Texture you can use to represent the need of a click or tap to proceed to next animated text. Animation will automatically control its enable/disable property but not drawing order.
(Talker Name): References a GUI-Texture you can use the name active animated text. The animation will automatically control its enable/disable property but not drawing order.
(Talker Avatar): References a GUI-Texture you can use the show off who is talking the animated text. The animation will automatically control its enable/disable property but not drawing order.
(Fade on Enable): If "true" the whole graphical composition will fade from full transparent to full opaque when enabled. This is controlled by Animation Interval.
(Fade on Disable): If "true" the whole graphical composition will fade from full opaque to full transparent when disabled. This is controlled by Animation Interval.
(Hide on Disable): If "true" when Enabled is "false" the GUI-Text object will stop drawing to the screen. This overrides Destroy on Disable.
(Destroy on Disable): If "true" when Enabled is "false" the GUI-Text object will be destroyed and recreated if Enabled turns to "true" again.
(Wait Mouse to Disable): If "true" the text will be destroyed or hided only when a click/tap occurs. In Unity 3 it works for mobiles too.
(Disable on Finish): If "true" the animated text will be destroyed or hided when text animation is finished. Wait Mouse to Disable overrides this, but this does not overrides Wait Mouse to Disable.

(Speed Boost): Protected property. If the player is holding down mouse/tap finger, the text's animation speeds up to finish quicker.


{Animating}: This output trigger fires every frame while the Smart Block is enabled.
{Finished}: This output trigger fires once and only when the text finished animation and is disabled after that. This fires again only if you destroy the GUI-Text object when disabled.
{While Finished}: This output trigger fires every frame after the text finished animation, it doesn't matter if the text is enabled or disabled after finished.
{Disabled}: This output trigger fires every frame while the Smart Block is disabled, even if the text never finished animation.


[Result]:
Image
Image


[Sample Graph]:
This is a graph in a scene where a character talks for a few minutes before the game starts.
For encapsulation in mobile tinny screens he talks at most four lines of text than another text appears and he keeps talking and talking...
To do that we simply add an Animated Text Smart Block with four lines than link to another one with more four lines and so one.
When the character finishes his monologue after a last click of the player, it fires a routine that makes the whole screen glow before loading next level.
Using the Destroy on Disable parameter when a dialog is closed no matter how many times he talks, the draw calls still always the same, not causing performance issues for devices.
Image

That screen shows off all the blocks with finished animation already, but they don't execute all at the same time because I used there the While Finished output trigger.
That means an Animated Text starts to run only when its previous parent finished to do it, even in Update loops, preventing them to increase draw calls and CPU usage.
Once an Animated Text finished its job it won't run all the animation system anymore, it will just pass-by the loop to the next parent starting its animation so,
they don't need to run all at the same time:
Image
Last edited by Viziopleasure on 03 May 2011, 14:18, edited 19 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Pause Screen

Postby Viziopleasure » 02 May 2011, 17:47

:!: [7] Pause Screen:

Image


[How To Use]:
º With Antares Universe and Smart Tools imported into your project, add a Graph to a game object.
º In Universe's explorer go to Smart Blocks > Smart Tools > Automation > Paused Game.
º Click it and drag to your working space:


(Do Pause): If this is "true", the GUI-Textures for the pause-screen will be created and after fade in, Time Scale will be set to zero. The screen will fade to a darker brightness and the game than will be paused.
(Pause Icon): If you want, you can use a texture to tell the player the game is actually paused.
(Icon Scale): The size of the icon in screen space, from 0 to 1.
(Fading Interval): Interval of time the screen fades its brightness. The righter the value, the slower the fading animation.
(Drawing Order): Set this value to a number high enough to make sure your pause-screen will be drawn over any other GUI-Texture. Default is 10000.
(Self-Update): If you're using a very simple mechanics, you may want this Smart Block to update itself, discarding a link to a Update Logic Block.


{Paused}: This Output Trigger will fire every frame while the game is paused.
{Unpause}: If the player clicks/taps the screen, the game will unpause; Unless you use an outside boolean value to control the pause state, at this case when the click/tap occurs use this to reset to outside variable.
{Unpaused}: This Output Trigger will fire every frame while the game is unpaused, even if it was never paused before.


[Note]: To pause the game you just need a Trigger, Button, etc to change the Do Pause value to "true" and the screen is automatically created.
In particular, I use FSMs into a general game manager(that is never destroyed) to do it if state = paused.


[Result]:
Image
A white screen faded to darker brightness while the game is paused.
Last edited by Viziopleasure on 09 May 2011, 21:26, edited 3 times in total.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Smart Tools

Postby Viziopleasure » 09 May 2011, 21:21

Reserved post.
User avatar
Viziopleasure
 
Posts: 115
Joined: 31 Mar 2011, 12:08

Re: Smart Tools

Postby ayzhong » 02 Jun 2011, 00:38

These are really great. Thanks a lot! A newbie question: Does this block stand alone or do we need an OnGui activator?

EDIT: Woops I figured it out. It does not need an OnGUI activator.
ayzhong
 
Posts: 1
Joined: 02 Jun 2011, 00:36


Return to Smart Blocks

Who is online

Registered users: No registered users