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:
ajuda sobre skybox
Salvar objetos que foram destruidos entre cenas na unity
MEU SIMULADOR DE CARRO
Quero começa a desenvolver um jogo de luta porem eu queria aprender a faze
Unity - SceneManager.LoadScene abre scene com objeto "vazio"
[_____IMPORTANTE_____] ALTERAÇÕES NA POLÍTICA DE COBRANÇA DA UNITY
[RESOLVIDO] Ausencia da funçao NavMesh na Unity 2022.2.12
Interação com elementos UI
[_____IMPORTANTE_____] ALTERAÇÕES NA POLÍTICA DE COBRANÇA DA UNITY - 2
Roll Up Um jogo de aventura e desáfios
Terminologia da Unity em outras engines
Como criar a iluminação do Sol no Sistema Solar?
Conexão de lobby pelo OnConnectedToMaster
Problema na exportção de projeto unity
[RESOLVIDO] Unity - Áudios estão emitindo som só Depois do Botão ser solto
Unity - Banco de Dados Online junto ao Jogo
Player virar para o inimigo(Prefab)
[TUTORIAL] Sistema De Save Game Ao Sair Da Fase
Problema de Sincronização de um objeto de um jogo multiplayer usa q Photon
Unity - Compartilhar meu Jogo
Alguém que manja do Google ADmob?
Unity - Avaliar meu Jogo
[RESOLVIDO] Destruir inimigo com o player.
Salvar e carregar dados na Unity de objetos prefabs sem sobrescrever os dad
Unity - Salvar os Dados do Jogador Online
Input.GetAxis() obedercer a orientação de um objeto.
ajuda com o sistema de drag and drop com controle no invetario
Como executar outros blocos fora do bloco static void Main()
Usando a biblioteca UnityEngine fora da Unity
Mixamo - Character Gratuito?
Touch mobile
Erro NullReferenceException Não consigo resolver
Criador de Sites Freelancer DISPONIVEL!!!
Unity - Não deixar o Jogador alterar o Jogo pelo regedit do pc?
Tiro com Botao UI (ME AJUDEM)
[Projeto em Andamento] Draug, um jogo de hordas
Vagas de programadores e modeladores para startup
Consigo herdar/ copiar parâmetros do animator da unity?
O que seriam os códigos-fonte?
[RESOLVIDO] Unity Vulkan - Out of memory! (allocating memory for image)
Unity Problema de Vírus
[TUTORIAL] Como fazer uma gota de água na Unity
Mirror ou Photon Pun 2 ??? para Mobile
Character Player Modular
Icones não aparecem na Interface da Unity
Verificar se player está posado em blogo
Logica para criar (Player, Inventario, Arma) - Mobile
Sistema de pegar passageiros
Trailer Final de O Labirinto II
Meu jogo não conecta no google play games
ALGUEM ME AJUDA PFV
Problema tentando inserir "Sprite"
Oferto Serviço Programação para Jogos
FAZER AÇÂO AO ENTRAR NO CAMPO DA CAMERA
[RESOLVIDO] QUEBRA DE LINHA NO PLACEHOLDER. Nao lembro como que faz
Unity - Qual o Limite Máximo de Linhas em um Script para q ele fique Leve?
movimento 2d
Alguém que ja publicou na steam pode me ajudar com isso?
Animação Unity toda bugada
UDaySurvival - Jogo de sobrevivência de mundo aberto para mobile!https://yo
Trailer do meu jogo O Labirinto II
Jogo Atisk (Trailer)
Adicionem meu jogo na lista de desejos
Discord!
Como executar a void de um outro scrypt
Shader não funciona no Unity URP
Jogo Mobile - Ultimate Flight Simulator - Real World SDK
Unity - FPS e CPU ???
Usar microfone na Unity
Jogo ficando escuro quando faço a Build pela cena menu
Dúvida sobre movimentação do personagem
[RESOLVIDO] ACESSAR SCRIPT DE OUTRO GAMEOBJECT
Para eu ter shader em meu projeto eu tenho que usar o hdrp ou o 3d padrao?
Rotate Camera Mobile
Sou modelador 3d (!!! Arquitetonico!!!) Disponivel !!!!!!
Preciso de alguém que saiba programação e Raycast
Servidor/cliente usando sockets
Assets carregados com addressables causando erro na versão "buildada"
Jogo multiplayer com salas - não vai para o lobby
Texto - Não escreve no 'play'. Clica mais não digita.
Câmera Não esta renderizando na segunda janela.
Movimento da Câmera No Android
[RESOLVIDO] - Unity não está mais funcionando o "Build and Run"
Precisa de modelador com ou sem experiência
Duvida com "mesclagem" de animação
Missoes Aparecerem aleatoriamente do nada
Dúvida pafra IOS
botoes não esta funcionando corretamente nem a fisica?
Duvida com NavMeshAgent
COMO AUMENTAR E DIMINUÍ A SENSIBILIDADE DO TOQUE POR CÓDICO (MOBILE)
A Licença da Unity só funciona se eu tiver Internet
Problema com OnTriggerEnter
Transparência ao colidir
bool para evitar de salvar frames repetido
Unity - Transições no AnimatorController rodando errado
problemas com "wall Jump" , atribuir força ao eixo X
Meu Jogo ja Esta Pronto! EXPERIMENTEM!!
JOSTICK NAO SE MOVE
botoes para mobile
Hoje à(s) 12:45 pm
Hoje à(s) 9:24 am
Ontem à(s) 9:02 pm
Ontem à(s) 8:57 pm
Ontem à(s) 1:37 pm
Ontem à(s) 9:47 am
Sáb Set 23, 2023 2:10 pm
Sáb Set 23, 2023 12:32 pm
Sex Set 22, 2023 9:01 pm
Qui Set 21, 2023 11:04 am
Qua Set 20, 2023 4:40 pm
Qua Set 20, 2023 9:15 am
Dom Set 17, 2023 12:17 pm
Sex Set 15, 2023 7:24 pm
Sex Set 15, 2023 5:41 pm
Sex Set 15, 2023 4:28 pm
Sex Set 15, 2023 10:56 am
Sex Set 15, 2023 10:15 am
Seg Set 11, 2023 11:43 am
Seg Set 11, 2023 11:31 am
Sáb Set 09, 2023 4:53 pm
Sáb Set 09, 2023 1:44 pm
Ter Set 05, 2023 11:12 pm
Ter Set 05, 2023 3:12 pm
Seg Set 04, 2023 11:53 pm
Seg Set 04, 2023 7:39 pm
Dom Set 03, 2023 9:47 pm
Sáb Set 02, 2023 11:53 am
Sex Set 01, 2023 2:21 pm
Qui Ago 31, 2023 8:19 pm
Qui Ago 31, 2023 6:15 pm
Qua Ago 30, 2023 11:21 am
Ter Ago 29, 2023 8:43 pm
Seg Ago 28, 2023 7:18 pm
Sáb Ago 26, 2023 4:49 pm
Sáb Ago 26, 2023 4:38 pm
Qui Ago 17, 2023 1:56 am
Qua Ago 16, 2023 10:21 pm
Seg Ago 14, 2023 12:28 pm
Dom Ago 06, 2023 5:24 pm
Dom Ago 06, 2023 10:58 am
Qui Ago 03, 2023 9:38 am
Qua Ago 02, 2023 8:20 am
Ter Ago 01, 2023 6:07 pm
Dom Jul 30, 2023 5:43 pm
Sáb Jul 29, 2023 7:24 pm
Qui Jul 27, 2023 9:27 am
Seg Jul 24, 2023 11:12 am
Seg Jul 24, 2023 12:44 am
Seg Jul 24, 2023 12:37 am
Seg Jul 24, 2023 12:17 am
Seg Jul 24, 2023 12:10 am
Qua Jul 19, 2023 11:37 am
Ter Jul 18, 2023 7:12 pm
Qua Jul 12, 2023 9:49 am
Ter Jul 11, 2023 8:58 am
Ter Jul 11, 2023 1:03 am
Seg Jul 10, 2023 9:10 pm
Sex Jul 07, 2023 4:14 pm
Ter Jul 04, 2023 12:11 am
Sex Jun 30, 2023 8:10 pm
Qui Jun 29, 2023 5:19 pm
Qui Jun 29, 2023 3:40 pm
Ter Jun 27, 2023 1:45 am
Seg Jun 19, 2023 11:03 am
Dom Jun 18, 2023 6:11 pm
Dom Jun 04, 2023 2:41 pm
Ter maio 30, 2023 7:28 pm
Ter maio 30, 2023 6:04 am
Seg maio 29, 2023 7:53 pm
Sáb maio 27, 2023 3:11 pm
Sex maio 26, 2023 4:59 pm
Sex maio 26, 2023 11:27 am
Qui maio 25, 2023 10:33 am
Sáb maio 20, 2023 12:25 pm
Ter maio 16, 2023 5:43 pm
Ter maio 16, 2023 5:42 pm
Ter maio 09, 2023 7:42 pm
Seg maio 08, 2023 7:13 am
Seg maio 08, 2023 6:38 am
Sáb maio 06, 2023 11:44 pm
Sáb maio 06, 2023 6:42 pm
Sáb maio 06, 2023 1:35 am
Qua maio 03, 2023 12:32 pm
Seg maio 01, 2023 8:51 pm
Dom Abr 30, 2023 8:49 pm
Dom Abr 30, 2023 5:06 pm
Sáb Abr 29, 2023 4:05 pm
Qui Abr 27, 2023 4:39 pm
Qui Abr 27, 2023 12:40 am
Ter Abr 25, 2023 5:33 pm
Ter Abr 25, 2023 10:23 am
Dom Abr 23, 2023 12:11 am
Sáb Abr 22, 2023 4:27 am
Sex Abr 21, 2023 11:38 pm
Sex Abr 21, 2023 10:21 pm
Qui Abr 20, 2023 4:57 pm
Qui Abr 20, 2023 12:28 pm
Qua Abr 19, 2023 3:03 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 : 3012
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