SchultzGames
Para tirar dúvidas, crie um tópico especifico na área "Dúvidas em Geral" e aguarde ser respondido. Evite comentar em tópicos não relacionados a sua dúvida :D
TÓPICOS RECENTES:
Tópico:
Postado em:
Postado por:
Jogo multiplayer com steam
Mini Quarteirão com Texturas 3D VENDA
Controle do braço e cabeça no fps
PRECISO FAZER QUE MEU GAME FIQUE ONLINE
Como resolver vazamento de memoria?
Procuro Pessoas para Projeto
Ativar o objeto correto em Clones.
[TUTORIAL] Como fazer um interruptor simples (Unity 2018)
Unity-RawImages e Renderizção c/ Câmera Jogo Lento e travnado. Alguém pfv?!
Preciso de 20 testadores jogo mobile
O Labirinto II - Trailer Oficial
Ue posso divulgar meu game que ainda esta em criaçao aqui no forum?
[RESOLVIDO] Inverter o sprite para a direçao que o personagem anda.
Set Active não a reabiilitado C#
Build APK VR Google Cardbord com video.
[PROGRAMADOR FREELA] $$
Mais Um jogo!
Collider (mesh?)
[TUTORIAL] Deformar mesh com batidas (para objetos, veículos, etc)
WW2 Low poly Pack (Free)
Procuro freelancer
Novo Teaser do jogo Dark Age
Unity Admob Erro
DEATH ISLAND 0.2.5 SURVIVAL GAME 4 ANOS EM DESENVOLVIMENTO
Player travando na colisão com o chão Unity 2D
Sombras estão quadradas na build
nao consigo fazer o player sentar no sofa alguem me ajuda
Unity - Ao mudar de scene, todas as Lights são deletadas
210 Linhas de código para inimigo é muito grande?
modelar avatar e skins para um jogo web
ShapeKeys do Blender para a Unity altera áreas próximas
COMO EVITAR QUE UM OBJETO (PLAYER,ITEM ETC...) ATRAVESSE UMA PAREDE.
Ajuda em Script de Verificação de Ação e Reação
unity Failed to load PlayerSettings (internal index #0). Most likely data f
Materiais do Blander não aparecem no MeshRendere do Objeto na Unity
Repetiçoes de Textura no Terreno
SERVER IS DOWN - UNITY+MSQL
Procuro programadores - Novo jogo
Problema com o MS VEHICLES
Preciso de ajuda com a Unity
Problema com vídeo em 360° na Unity
Problemas no MS Vehicles
unity- eventos na Animação com Armature/Bones vinda do blender não funciona
ajuda exibir resultados simulados em uma liga Game Unity
Unity - ParticleSystem não é redirecionado no rawimage no canvas
Como resolver o problema de "face orientation" no Blender.
[DÚVIDA] Tive um problema com meu Canvas
erro na Directional Light
Problemas com o Directional Light da Unity 3D
Novo jogo da franquia Sphere game em desenvolvimento
malha da roda não girando com wheel collider unity
Problemas com ambiguidade
Touch mobile
INVALID TOKEN
Como acessar o "HD Render Pipeline" do HDRP por script?
CHAT GPT PRA JOGO DE TIRO? comentem
Tutorial script inimigo segue e foge do player
Ainda vale a pena lançar Asset na Asset Store?
Ajuda com tabela de historico de pontuaçao.
[TUTORIAL] Entrar no carro estilo GTA
Como derrapar um Whell Collider
Como altertar o valor do "Asymptote Value" do Whell Collider via Script
Preciso de ajuda para substituir valor de variavel em outro script
Ajuda com Top Down Shooter utilizando Photon
Duvida com Netcode
[RESOLVIDO] Unity - Movendo a Câmera na Horizontal/Vertical com Touch
Alguém me ajuda com os anúncios pfv
Segundo Trailer do jogo Dark Age, Feliz Natal a todos!
Unity - ScrollRect, Viewport, Content - O Conteúdo ñ inicia no topo
Coleta de itens
Unity - Cadastro do email do jogador
[GRATIS] PACK DE MODELOS 3D PARA JOGO DE TERROR
Onde Conseguir músicas para meu Jogo?
error CS0246 em Script
Alguem teve ja esse problema?
[Projeto em Andamento] Draug, um jogo de hordas
DISPONIVEL PARA FAZER MODELOS 3D
Unity-Loja.Como os Jogadores terão acesso aos ítens comprados na PlayStore?
Bugando depois do Build.
Primeiro Trailer do jogo Dark Age
Problema com sombra
Mesh e Material do objeto trocando para uma instancia no inicio do jogo
[RESOLVIDO] Unity - RawImages_Layer_Camera
INVESTIMENTO EM JOGOS E BANCO DE TALENTO
Teaser do meu novo projeto pessoal, Dark Age
Preciso de ajuda com mudança para mobile androide.
[RESOLVIDO] Posição final do objeto em jogo 2D
Input.GetAxis() obedercer a orientação de um objeto.
Interação com elementos UI
Meu primeiro jogo na steam
Minimap/Radar/GPS Estilo GTA V
[RESOLVIDO] Erro no console depois que formatei o pc
PACK GRÁTIS de Músicas ELETRÔNICAS para ajudar vocês em seus Jogos Indies!
[TUTORIAL] Entenda como funciona: ENUM, SWITCH, BREAK, CASE no C#
O Labirinto II - Baixe o Jogo
Qual e o codigo de Botões na unity para saber seus estados?
Como carregar itens pequenos dentro do carro sem que atravesse os colliders
[Duvida] Script pegar itens
Travamento ao trocar de cena
Ontem à(s) 5:53 pm
Qui Jul 25, 2024 2:48 pm
Dom Jul 21, 2024 7:07 pm
Dom Jul 21, 2024 12:07 am
Seg Jul 15, 2024 7:02 pm
Dom Jul 14, 2024 11:24 pm
Sáb Jul 13, 2024 12:33 am
Qui Jun 27, 2024 5:49 pm
Sáb Jun 22, 2024 9:05 pm
Qui Jun 20, 2024 12:30 pm
Dom Jun 09, 2024 7:43 pm
Dom Jun 09, 2024 2:16 pm
Seg Jun 03, 2024 11:39 am
Seg maio 27, 2024 12:45 pm
Seg maio 20, 2024 9:01 pm
Dom maio 19, 2024 3:08 pm
Sáb maio 18, 2024 11:46 am
Sáb maio 11, 2024 8:55 am
Qui maio 09, 2024 11:33 pm
Seg Abr 29, 2024 9:34 pm
Qui Abr 25, 2024 3:34 pm
Seg Abr 22, 2024 5:15 pm
Seg Abr 15, 2024 12:23 pm
Qua Abr 10, 2024 1:33 am
Ter Abr 09, 2024 10:28 am
Seg Abr 08, 2024 9:27 pm
Seg Abr 08, 2024 8:01 am
Sáb Abr 06, 2024 8:05 pm
Qui Abr 04, 2024 11:34 pm
Qui Abr 04, 2024 11:13 pm
Sex Mar 22, 2024 2:41 pm
Dom Mar 10, 2024 2:30 pm
Sex Mar 01, 2024 1:27 pm
Qui Fev 22, 2024 9:57 pm
Ter Fev 20, 2024 12:15 am
Seg Fev 19, 2024 1:06 pm
Seg Fev 12, 2024 1:56 pm
Seg Fev 12, 2024 1:17 pm
Dom Fev 11, 2024 8:55 pm
Dom Fev 11, 2024 11:16 am
Seg Fev 05, 2024 4:18 pm
Dom Fev 04, 2024 9:39 pm
Qua Jan 31, 2024 11:59 pm
Ter Jan 30, 2024 7:37 pm
Ter Jan 23, 2024 6:33 pm
Dom Jan 21, 2024 6:03 pm
Sáb Jan 20, 2024 7:03 pm
Sáb Jan 20, 2024 6:58 pm
Sáb Jan 20, 2024 6:39 pm
Sex Jan 19, 2024 8:40 am
Dom Jan 14, 2024 5:30 pm
Qua Jan 10, 2024 10:29 pm
Qua Jan 10, 2024 8:55 pm
Qua Jan 10, 2024 7:14 pm
Ter Jan 09, 2024 3:55 pm
Ter Jan 09, 2024 8:04 am
Sáb Jan 06, 2024 8:02 pm
Sex Jan 05, 2024 7:01 am
Sex Jan 05, 2024 12:12 am
Qui Jan 04, 2024 6:55 pm
Qui Jan 04, 2024 12:52 pm
Qui Jan 04, 2024 4:34 am
Ter Jan 02, 2024 11:48 pm
Dom Dez 31, 2023 7:25 pm
Qua Dez 27, 2023 5:44 pm
Qua Dez 27, 2023 3:08 pm
Sáb Dez 23, 2023 7:27 pm
Sáb Dez 23, 2023 5:06 pm
Qui Dez 21, 2023 8:10 pm
Seg Dez 18, 2023 2:04 pm
Sex Dez 15, 2023 5:11 pm
Qui Dez 14, 2023 9:13 pm
Qui Dez 14, 2023 2:47 pm
Qui Dez 14, 2023 1:48 pm
Qua Dez 13, 2023 8:58 pm
Ter Dez 12, 2023 2:32 pm
Seg Dez 11, 2023 1:53 pm
Qua Dez 06, 2023 8:13 pm
Sáb Dez 02, 2023 8:06 pm
Qui Nov 30, 2023 7:49 am
Seg Nov 27, 2023 1:35 am
Qua Nov 22, 2023 7:37 am
Qui Nov 09, 2023 1:22 pm
Seg Nov 06, 2023 11:59 am
Ter Out 31, 2023 9:53 am
Dom Out 29, 2023 8:05 pm
Dom Out 29, 2023 3:03 am
Sex Out 27, 2023 3:43 pm
Sex Out 27, 2023 3:28 pm
Qua Out 25, 2023 1:20 pm
Seg Out 23, 2023 10:34 am
Dom Out 22, 2023 6:55 pm
Qui Out 19, 2023 11:57 pm
Qui Out 19, 2023 6:39 pm
Ter Out 17, 2023 6:37 pm
Ter Out 17, 2023 6:18 pm
Seg Out 16, 2023 1:59 pm
Sáb Out 14, 2023 12:15 pm
Qua Out 11, 2023 6:07 pm



































































































[TUTORIAL] Unity3d GuiText (Pause)

Ir para baixo

TUTORIAL [TUTORIAL] Unity3d GuiText (Pause)

Mensagem por GabrielWorks Sex Jul 31, 2015 9:09 pm

um script foda de pause

Código:
/* GabrielWorks Pause */

#pragma strict
#pragma downcast
#pragma implicit

// note a version of this pause menu is also on the Unify wiki and there is a discussion thread specifically for it on the Unity forum
var skin:GUISkin;

var allowPause:boolean = true; // allow ESC to bring up pause menu
var startPaused:boolean = false; // start game with pause menu up
var lockCursor:boolean = true; // cursor is locked when not paused

var legalwidth:int = 120;

var menutop:int=25;

private var gldepth = -0.5;
private var startTime = 0.1;

var mat:Material;

private var tris = 0;
private var verts = 0;
private var savedTimeScale:float;
// commented out for Unity Indie - used to enable image effect when pause menu is up
//private var pauseFilter;

private var showfps:boolean;
private var showtris:boolean;
private var showvtx:boolean;
private var showfpsgraph:boolean;

// minimal piracy check for webplayers
var checklegal:boolean = false;
var publisher = "fugugames.com"; // change this to your webplayer site
var srcValue = null;

var lowFPSColor = Color.red;
var highFPSColor = Color.green;

var lowFPS = 30;
var highFPS = 50;

var start:GameObject;

var goal:String = "All your base belong to us!"; // goal statement displayed on pause menu

var statColor:Color = Color.yellow;
var hudColor:Color = Color.white;

// fill in the help text that is initially presented
var help:String[] = ["ESC - pause game"];

// fill in the credit info for your game
var credits:String[]=[
"Electronic Dog Studios",
"Copyright (c) 2014-2015 Technicat, LLC. All Rights Reserved.",
"Electronic Dog Graphics"] ;
var crediticons:Texture[]; // images you want shown on the credit screen

// for playing a movie in the credits screen
// fill in the url of the OGG movie file
// Unity Pro only
//private var movie:MovieTexture;
//var fmv = "cat.ogv";

// enums for each page of the menu (you can think of each as a state in a state machine)
enum Page {
None,Main,Options,Credits,Help
}

private var currentPage:Page;

// fps graph
private var fpsarray:int[];
private var fps:float;

function Awake() {
fpsarray = new int[Screen.width];
}

function Start() {
if (lockCursor) {
Screen.lockCursor = true;
}
// movie = null;
// if (allowPause) {
// if (fmv != "") {
// var www = WWW(fmv);
// movie = www.movie;
// }
// if (movie != null) {
// while (!movie.isReadyToPlay) {
// yield;
// }
// movie.loop = true;
// }
Time.timeScale = 1.0;
if (startPaused) {
PauseGame();
}

}

function OnPostRender() {
if (showfpsgraph && mat != null) {
GL.PushMatrix ();
GL.LoadPixelMatrix();
for (var i = 0; i < mat.passCount; ++i)
{
mat.SetPass(i);
GL.Begin( GL.LINES );
for (var x=0; x GL.Vertex3(x,fpsarray[x],gldepth);
}
GL.End();
}
GL.PopMatrix();
ScrollFPS();
}
}

function ScrollFPS() {
for (var x=1; x fpsarray[x-1]=fpsarray[x];
}
if (fps < 1000) {
fpsarray[fpsarray.length-1]=fps;
}
}

static function IsDashboard() {
return Application.platform == RuntimePlatform.OSXDashboardPlayer;
}

static function IsBrowser() {
return (Application.platform == RuntimePlatform.WindowsWebPlayer ||
Application.platform == RuntimePlatform.OSXWebPlayer);
}

static function IsDesktop() {
return (Application.platform == RuntimePlatform.WindowsPlayer ||
Application.platform == RuntimePlatform.OSXPlayer);
}

function LateUpdate () {
if (showfps || showfpsgraph) {
FPSUpdate();
}
if (allowPause && Input.GetKeyDown("escape"))
{
switch (currentPage) {
case Page.None: PauseGame(); break;
default: currentPage = Page.Main;
}
}
}

function OnGUI () {
if (skin != null) {
GUI.skin = skin;
}
ShowStatNums();
if (checklegal) {
ShowLegal();
}
if (IsGamePaused()) {
GUI.color = hudColor;
switch (currentPage) {
case Page.Main: PauseMenu(); break;
case Page.Options: ShowOptions(); break;
case Page.Credits: ShowCredits(); break;
case Page.Help: ShowHelp(); break;
}
}
}

function ShowLegal() {
if (!IsLegal()) {
GUI.Label(Rect(Screen.width-legalwidth,Screen.height-20,legalwidth-10,20),
publisher);
}
}

function IsLegal() {
return !IsBrowser() || 
( IsLegalSrc() && 
Application.absoluteURL.StartsWith("http://www."+publisher+"/")) ||
( IsLegalSrc() &&
Application.absoluteURL.StartsWith("http://"+publisher+"/"));
}

function IsLegalSrc() {
return (Application.srcValue == null) || (Application.srcValue == srcValue);
}

private var toolbarInt:int=0;
private var toolbarStrings: String[]= ["Audio","Graphics","Controls","Stats","System"];

function ShowOptions() {
BeginPage(318,300);
toolbarInt = GUILayout.Toolbar (toolbarInt, toolbarStrings);
switch (toolbarInt) {
case 0: VolumeControl(); break;
case 4: ShowDevice(); break;
case 1: QualityControl(); Qualities(); break;
case 3: StatControl(); break;
case 2: ShowHelp();
}
EndPage();
}

function ShowCredits() {
BeginPage(300,300);
for (var credit in credits) {
GUILayout.Label(credit);
}
for (var credit in crediticons) {
GUILayout.Label(credit);
}
// if (movie != null) {
// GUILayout.Box(movie);
// if (movie.isReadyToPlay) {
// movie.Play();
// }
// }
EndPage();
}

function ShowHelp() {
for (var tip in help) {
GUILayout.Label(tip);
}
lockCursor = GUILayout.Toggle(lockCursor,"Hide Cursor");
}


function ShowBackButton() {
if (GUI.Button(Rect(20,Screen.height-50,50,20),"Back")) {
currentPage = Page.Main;
}
}

function Available(isAvailable) {
return isAvailable ? "Available" : "Not Available";
}

function ShowDevice() {
GUILayout.Label ("Unity player version "+Application.unityVersion);
GUILayout.Label("Graphics: "+SystemInfo.graphicsDeviceName+" "+
SystemInfo.graphicsMemorySize+"MB\n"+
SystemInfo.graphicsDeviceVersion+"\n"+
SystemInfo.graphicsDeviceVendor);
GUILayout.Label("Shadows: "+ Available(SystemInfo.supportsShadows));
GUILayout.Label("Image Effects: "+Available(SystemInfo.supportsImageEffects));
GUILayout.Label("Render Textures: "+Available(SystemInfo.supportsRenderTextures));
}

function Qualities() {
GUILayout.Label(QualitySettings.names[QualitySettings.GetQualityLevel()]);
GUILayout.Label("Pixel Light Count: "+QualitySettings.pixelLightCount);
GUILayout.Label("Shadow Cascades: "+QualitySettings.shadowCascades);
GUILayout.Label("Shadow Distance: "+QualitySettings.shadowDistance);
GUILayout.Label("Soft Vegetation: "+QualitySettings.softVegetation);
// GUILayout.Label("Sync to VBL: "+QualitySettings.syncToVBL);
// Screen.fullScreen = GUILayout.Toggle(Screen.fullScreen,"Full Screen");
}

function QualityControl() {
GUILayout.BeginHorizontal();
if (GUILayout.Button("Decrease")) {
QualitySettings.DecreaseLevel();
}
if (GUILayout.Button("Increase")) {
QualitySettings.IncreaseLevel();
}
GUILayout.EndHorizontal();
}

function VolumeControl() {
GUILayout.Label("Volume");
AudioListener.volume = GUILayout.HorizontalSlider(AudioListener.volume,0.0,1.0);
//if (!IsBrowser())
//speech = GUILayout.Toggle(speech,"Text to Speech");
}

function StatControl() {
GUILayout.BeginHorizontal();
showtris = GUILayout.Toggle(showtris,"Triangles");
showvtx = GUILayout.Toggle(showvtx,"Vertices");
showfps = GUILayout.Toggle(showfps,"FPS");
showfpsgraph = GUILayout.Toggle(showfpsgraph,"FPS Graph");
GUILayout.EndHorizontal();
}

function FPSUpdate() {
var delta = Time.smoothDeltaTime;
if (!IsGamePaused() && delta !=0.0) {
fps = 1 / delta;
}
}

function ShowStatNums() {
GUILayout.BeginArea(Rect(Screen.width-100,10,100,200));
if (showfps) {
var fpsString= fps.ToString ("#,##0 fps");
GUI.color = Color.Lerp(lowFPSColor, highFPSColor,(fps-lowFPS)/(highFPS-lowFPS));
GUILayout.Label (fpsString);
}
if (showtris || showvtx) {
GetObjectStats();
GUI.color = statColor;
}
if (showtris) {
GUILayout.Label (tris+"tri");
}
if (showvtx) {
GUILayout.Label (verts+"vtx");
}
GUILayout.EndArea();
}

function BeginPage(width:int,height:int) {
GUILayout.BeginArea(Rect((Screen.width-width)/2,menutop,width,height));
}

function EndPage() {
GUILayout.EndArea();
if (currentPage != Page.Main) {
ShowBackButton();
}
}

function IsBeginning() {
return Time.time < startTime;
}


function PauseMenu() {
BeginPage(200,200);
if (GUILayout.Button (IsBeginning() ? "Play" : "Continue")) {
UnPauseGame();
}
if (GUILayout.Button ("Options")) {
currentPage = Page.Options;
}
if (GUILayout.Button ("Credits")) {
currentPage = Page.Credits;
}
if (IsDesktop() && GUILayout.Button ("Quit")) {
Application.Quit();
}
if (IsBeginning()) {
GUILayout.Label(goal);
GUILayout.Label("Hit ESC key to pause");
}
EndPage();
}

function GetObjectStats() {
verts = 0;
tris = 0;
var ob = FindObjectsOfType(GameObject);
for (var obj in ob) {
if (obj.active) {
GetObjectStats(obj);
}
}
}

function GetObjectStats(object:GameObject) {
var filters : Component[];
filters = object.GetComponentsInChildren(MeshFilter);
for( var f:MeshFilter in filters )
{
tris += f.sharedMesh.triangles.Length/3;
verts += f.sharedMesh.vertexCount;
}
}

function PauseGame() {
savedTimeScale = Time.timeScale;
Time.timeScale = 0;
AudioListener.pause = true;
// if (pauseFilter) pauseFilter.enabled = true;
currentPage = Page.Main;
Screen.lockCursor = false;
}

function UnPauseGame() {
Time.timeScale = savedTimeScale;
AudioListener.pause = false;
// if (pauseFilter) pauseFilter.enabled = false;
currentPage = Page.None;
if (IsBeginning() && start != null) {
start.active = true;
}
// if (movie != null && movie.isPlaying) {
// movie.Pause();
// }
if (lockCursor) {
Screen.lockCursor = true;
}
}

static function IsGamePaused() {
return Time.timeScale==0;
}

// this used to be necessary? hopefully not anymore
//function OnApplicationPause(pause:boolean) {
// if (IsGamePaused()) {
// AudioListener.pause = true;
// if (movie != null && movie.isReadyToPlay) {
// movie.Play();
// }
// }
//}

GabrielWorks
Iniciante
Iniciante

PONTOS : 3317
REPUTAÇÃO : 5

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos