private void Awake() { shaderino = Shader.Find("Custom/Autofade"); DontDestroyOnLoad(this); m_Instance = this; m_Material = new Material(shaderino); }
IEnumerator Down(GameObject G) { if (G.name == "TF_Lineup") { G.transform.FindChild("Scroll View").gameObject.SetActive(false); G.transform.FindChild("Scroll View 1").gameObject.SetActive(false); } // for (int i =0; i<5; i++) { // if(G.transform.localPosition.y<-1900f){ // G.transform.localPosition=new Vector3(G.transform.localPosition.x, -1900f,G.transform.localPosition.z); // break; // // }else if(G.transform.localPosition.y!=-1900f){ // G.transform.localPosition -= new Vector3(0,1334.5f/5f,0); // yield return new WaitForSeconds(0.02f); // }else{ // break; // } // } G.SetActive(false); Debug.Log(GachaCount); if (GachaCount > 0 && Application.loadedLevelName.Equals("SceneCards")) { AutoFade.LoadLevel("SceneCards", 0f, 1f); } yield return(new WaitForSeconds(0f)); }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; m_Material = Resources.Load<Material>("Plane_No_zTest"); #if UNITY_EDITOR if (m_Material == null) { var resDir = new System.IO.DirectoryInfo(System.IO.Path.Combine(Application.dataPath, "Resources")); if (!resDir.Exists) resDir.Create(); Shader s = Shader.Find("Plane/No zTest"); if (s == null) { string shaderText = "Shader \"Plane/No zTest\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off Fog { Mode Off } BindChannels { Bind \"Color\",color } } } }"; string path = System.IO.Path.Combine(resDir.FullName, "Plane_No_zTest.shader"); Debug.Log("Shader missing, create asset: " + path); System.IO.File.WriteAllText(path, shaderText); UnityEditor.AssetDatabase.Refresh(UnityEditor.ImportAssetOptions.ForceSynchronousImport); UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Resources/Plane_No_zTest.shader"); s = Shader.Find("Plane/No zTest"); } var mat = new Material(s); mat.name = "Plane_No_zTest"; UnityEditor.AssetDatabase.CreateAsset(mat, "Assets/Resources/Plane_No_zTest.mat"); m_Material = mat; } #endif }
public void NextRound() { round++; Save(); Load(); AutoFade.LoadLevel(2, 0.5f, 0.5f, Color.black); }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; var shader = Shader.Find ("Unlit Transparent Vertex Colored"); m_Material = new Material(shader); }
// //Multiplayer public void MultiRestart(int inplay = 0) { Save(); MultiReset(inplay); Load(); AutoFade.LoadLevel(2, 0.5f, 0.5f, Color.black); }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { AutoFade.LoadLevel("MainPath2", 1, 1, Color.black); } }
public void Enemy_Die_Check(string SCENE) { if (Enemy_Die == true) //총알을 맞았다면 { transform.localScale = new Vector2(transform.localScale.x - 0.01f, transform.localScale.y - 0.01f); //스케일은 작아짐 transform.Rotate(new Vector3(0, 0, 10)); //계속 회전함 if (transform.localScale.x <= 0) //만약 스케일x값이 0보다 작다면 { Destroy(this.gameObject); //자기 자신 삭제 } GameObject[] obj = GameObject.FindGameObjectsWithTag("BULLETS");//총알 래드,블루 모두 삭제 할수있게끔 // BULLETS 태그를 가진 오브젝트를 모두 찾아서 배열에 추가 foreach (GameObject ob in obj) { Destroy(ob); AutoFade.LoadLevel(SCENE, 2, 3, Color.black); } } if (Enemy_Die == false) //총알을 맞지않았다면 { if (transform.position.y <= -10) //만약 Y값이 -10보다 작거나 같다면 { Destroy(this.gameObject); //자기 자신 삭제 } } }
void OnMouseUp() { renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, 1f); gameObject.audio.Play(); SaveLoadSystem.getInstance().resetSave(); AutoFade.LoadLevel(startStageName, 0.5f, 0.5f, Color.black); }
public virtual void OnMouseDown() { Hashtable scaleDown = new Hashtable(); scaleDown.Add("scale", mScaleDown); scaleDown.Add("time", 0.10f); Hashtable scaleUp = new Hashtable(); scaleUp.Add("scale", mScaleUp); scaleUp.Add("time", 0.10f); scaleUp.Add("delay", 0.15f); iTween.ScaleTo(gameObject, scaleDown); iTween.ScaleTo(gameObject, scaleUp); if (buttonPress) { audio.PlayOneShot(buttonPress); } if (levelName != "") { AutoFade.LoadLevel(levelName, 1.0f, 1.0f, Color.black); } }
void Btn_Exit() { CSSoundMng.I.Play("MenuEF_Button"); JHGameData_Mng.I.SetGameOver(); AutoFade.LoadLevel("1_Title", 0.3f, 0.3f, Color.black); }
/* public void Update() { * if(Input.GetKeyDown( KeyCode.U) ) { * while(hardpointCount>0) { * RemoveHardpoint(); * } * } * } */ public void RemoveHardpoint() { hardpointCount--; // Debug.Log("Megaship hardpoints remaining: " + hardpointCount); // now on HUD! if (hardpointCount <= 0) { GameObject.Instantiate(megashipDeathExplosionFire, megashipExplosionCenter.transform.position, megashipExplosionCenter.transform.rotation * Quaternion.AngleAxis(90.0f, Vector3.right)); SoundCenter.instance.PlayClipOn( SoundCenter.instance.megashipBoom, Camera.main.transform.position, 1.0f, Camera.main.transform); Destroy(megashipParent, 0.45f); if (GameStateStaticProgress.cheatsOn == false && PlayerControl.instance.isDead == false) { PlayerPrefs.SetInt(transform.parent.name, 2); } if (PlayerControl.instance) { PlayerControl.instance.FinishedLevel(); } else { AutoFade.LoadLevel("Level Select", Color.white); } } }
void OnMouseOver() { if (Input.GetMouseButtonDown(0)) { AutoFade.LoadLevel("Main", 2, 2, Color.white); } }
// Update is called once per frame void Update() { if (count == 2) { if (Input.GetKeyDown(KeyCode.C)) { Debug.Log(count); AutoFade.LoadLevel("Beach", 1, 1, Color.black); //Destroy (Scene3); } } if (count == 1) { if (Input.GetKeyDown(KeyCode.C)) { Debug.Log(count); Destroy(Scene2); count++; } } if (Input.GetKeyDown(KeyCode.C) && count == 0) { Destroy(Scene1); count++; } }
IEnumerator Cor_Login() { //Debug.Log("ID : " + m_pInput_ID.value + " , PASS : "******"" +JAManager.I.GetAccountSearch(m_pInput_ID.value, m_pInput_Pass.value), 1f); if (bConnect == true) { if (JAManager.I.GetUser_LoginCheck(JAManager.I.m_sMyAccount) <= 0) { JAManager.I.SetUpdate_LoginCheck(JAManager.I.m_sMyAccount, 1); HL_SoundMng.I.Play("SFX", "stinger"); HL_SoundMng.I.SetVolue("SFX", "stinger", 0.35f); JAManager.I.SoundBGMMute(JAManager.I.m_bSoundBGMMute); JAManager.I.SoundSFXMute(JAManager.I.m_bSoundSFXMute); AutoFade.LoadLevel("Menu", 0.3f, 0.3f, Color.white); } else { JAPopupManager.I.Create_Notice("이미 로그인 상태입니다.", 1f); StopCoroutine(Cor_Login()); } } else { JAPopupManager.I.Create_Notice("존재하지 않는 계정입니다", 1f); StopCoroutine(Cor_Login()); } yield return(null); }
public void Restart() { Save(); Reset(); Load(); AutoFade.LoadLevel(2, 0.5f, 0.5f, Color.black); }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; // Set the texture so that it is the the size of the screen and covers it. blackScreen = this.GetComponent <SpriteRenderer>(); }
// Update is called once per frame void Update() { // Checking lives count int lives = total_lives - (destroy_block_blue.block_lives_blue + destroy_block_red.block_lives_red); // int lives = total_lives; GetComponent <GUIText>().text = "Lives: " + lives; if (OnButtonTouch.quit == 1) { Time.timeScale = 1; Application.LoadLevel("Menu Temp"); } // When all lives are lost if (lives < 1) { //highscore PlayerPrefs.SetInt("totalCoins", totalCoins + Score.score); if (Score.score > highscore) { highscore = Score.score; PlayerPrefs.SetInt("Highscore", highscore); PlayerPrefs.Save(); } //game over screen AutoFade.LoadLevel("GameOver", 1 / 5, 1, Color.black); } }
public void PlayGame() { //TODO: Fix scene setup Stats.instance = new Stats.data(); AutoFade.LoadLevel(1, 2f, 2f, Color.black); Debug.Log("Play Game"); }
void OnCollisionEnter2D() { GameInformation.spawnPoint = 1; GameInformation.houseExit = 1; //house exit = wood house Destroy(GameObject.FindWithTag("Map")); AutoFade.LoadLevel("VillageHouseWood", 1, 1, Color.black); }
void OnChangeScreen(string levelName) { audio.PlayOneShot(clickButtonClip); soundManager.control = SoundControl.OUT; AutoFade.LoadLevel(levelName, 1.5f, 1.5f, Color.black); }
void ConnectHandlerForHttp(DialogueMgr.BTNS btn) { if (btn == DialogueMgr.BTNS.Btn1) { Debug.Log("ReTry"); WWW www; if (mReqParam != null) { www = new WWW(mUrl, mReqParam); } else if (mForm != null) { www = new WWW(mUrl, mForm); } else { www = new WWW(mUrl); } StartCoroutine(webAPIProcess(www, mBaseEvent, mIsLoading, mIsUpload)); // mWWW = null; // mBaseEvent = null; } else { if (Application.loadedLevelName.Equals("SceneLogin")) { Application.Quit(); } else { AutoFade.LoadLevel("SceneLogin"); } } }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; m_Material = Resources.Load <Material>("Plane_No_zTest"); #if UNITY_EDITOR if (m_Material == null) { var resDir = new System.IO.DirectoryInfo(System.IO.Path.Combine(Application.dataPath, "Resources")); if (!resDir.Exists) { resDir.Create(); } Shader s = Shader.Find("Plane/No zTest"); if (s == null) { string shaderText = "Shader \"Plane/No zTest\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off Fog { Mode Off } BindChannels { Bind \"Color\",color } } } }"; string path = System.IO.Path.Combine(resDir.FullName, "Plane_No_zTest.shader"); Debug.Log("Shader missing, create asset: " + path); System.IO.File.WriteAllText(path, shaderText); UnityEditor.AssetDatabase.Refresh(UnityEditor.ImportAssetOptions.ForceSynchronousImport); UnityEditor.AssetDatabase.LoadAssetAtPath <Shader>("Resources/Plane_No_zTest.shader"); s = Shader.Find("Plane/No zTest"); } var mat = new Material(s); mat.name = "Plane_No_zTest"; UnityEditor.AssetDatabase.CreateAsset(mat, "Assets/Resources/Plane_No_zTest.mat"); m_Material = mat; } #endif }
void OnGUI() { //Initialize values acording to screen size. scale.y = Screen.height / originalHeight; scale.x = scale.y; scale.z = 1; float scaleX = Screen.width / originalWidth; //Save Matrix, what this does is saving the values of the GUI Matrix(translation, scale, rotation) //Open matrix calculation. Matrix4x4 svMatrix = GUI.matrix; //Recalculate the matrix.. GUI.matrix = Matrix4x4.TRS(new Vector3((scaleX - scale.y) / 2, 0, 0), Quaternion.identity, scale); //Button clickable. You dont need anymore neither define the position( This needs to be properly tested). if (GUI.Button(new Rect(70, 10, 100, 50), "MAIN MENU")) { //Application.LoadLevel("GAMES_MENU"); AutoFade.LoadLevel("MAIN_MENU", 1, 1, Color.black); } //Close and return ne Matrix value. GUI.matrix = svMatrix; }
public void GameStart() { try { xMLManager.itemDB.Initialize(); //xMLManager.SaveItems(); //PlayerPrefs.DeleteAll();//level exp savelasttime load PlayerPrefs.SetInt("level", level); PlayerPrefs.SetFloat("exp", 0); if (PlayerPrefs.GetString("load", "false") == "false") //처음 { PlayerPrefs.SetString("load", "first"); //file 있음 } else { if (PlayerPrefs.GetString("load", "false") != "true") { //stay first... need tutorial } else//true 처음도 아니고 튜토리얼을 안봐도됨 { PlayerPrefs.SetString("load", "true");//file 있음 } } AutoFade.LoadLevel("MainScene", 1, 1, Color.black); } catch (Exception e) { single.SetAlert(e.ToString(), Color.red); } }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; mat = new Material(Shader.Find("UI/Default")); mesh = new Mesh(); }
// Update is called once per frame void Update() { if (Input.anyKey) { AutoFade.LoadLevel("main", .5f, .5f, Color.black); } }
void OnCollisionEnter2D() { GameInformation.currentScene = "FieldAfterVillage1"; GameInformation.spawnPoint = 7; Destroy(GameObject.FindWithTag("Map")); AutoFade.LoadLevel("FieldAfterVillage1", 1, 1, Color.black); }
void OnTriggerEnter(Collider other) { //If player collides with this, send him to the next level if (other.gameObject.tag == "Player") { Health playerStatus = other.gameObject.GetComponent <Health>(); if (playerStatus.Dead) { return; } else { playerStatus.Invincible = false; } if (soundEffect != null) { audio.PlayOneShot(soundEffect); } GameObject.Find("Menu Screens").GetComponent <PauseMenu>().canPause = false; PlayerPrefs.SetInt("startLocation", startLocation); AutoFade.LoadLevel(Level, 1, 1.4f, Color.black); } }
private void Update() { if (Input.GetButtonDown("Esc")) { if (MenuVisible) { DisableMenu(); MenuVisible = false; } else { EnableMenu(); MenuVisible = true; } } if (MenuVisible) { if (Input.GetAxisRaw("Vertical") < .1f && Input.GetAxisRaw("Vertical") > -.1f) { canSwitchAgain = true; } if (canSwitchAgain && Input.GetAxisRaw("Vertical") > .1f) { canSwitchAgain = false; menuSelection("up"); GetComponent <AudioSource>().Play(); } else if (canSwitchAgain && Input.GetAxisRaw("Vertical") < -.1f) { canSwitchAgain = false; menuSelection("down"); GetComponent <AudioSource>().Play(); } else if (!optionSelected && Input.GetButton("attack")) { optionSelected = true; switch (selectedIndex) { case 0: MusicManager.instance.VictorySong(); AutoFade.LoadLevel("main", 1, 1, Color.black); break; case 1: Application.Quit(); break; } } selector.transform.GetChild(0).GetComponent <RectTransform>().anchorMin = new Vector2(selector.transform.GetChild(0).GetComponent <RectTransform>().anchorMin.x, menuOptions.ElementAt(selectedIndex).Value.x); selector.transform.GetChild(0).GetComponent <RectTransform>().anchorMax = new Vector2(selector.transform.GetChild(0).GetComponent <RectTransform>().anchorMax.x, menuOptions.ElementAt(selectedIndex).Value.y); selector.transform.GetChild(1).GetComponent <RectTransform>().anchorMin = new Vector2(selector.transform.GetChild(1).GetComponent <RectTransform>().anchorMin.x, menuOptions.ElementAt(selectedIndex).Value.x); selector.transform.GetChild(1).GetComponent <RectTransform>().anchorMax = new Vector2(selector.transform.GetChild(1).GetComponent <RectTransform>().anchorMax.x, menuOptions.ElementAt(selectedIndex).Value.y); } }
// Update is called once per frame void Update() { if (Input.anyKeyDown) { AutoFade.LoadLevel("LevelSelect", 3, 1, Color.black); } }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { AutoFade.LoadLevel("Menu", 1, 1, Color.black); } }
void OnGUI() { if (counts == 1) { if (pause) { GUI.Box(new Rect(580, 100, 100, 180), "Pause"); if (GUI.Button(new Rect(590, 120, 80, 20), "Quit")) { Application.Quit(); } if (GUI.Button(new Rect(590, 140, 80, 20), "Main Menu")) { pause = false; counts = 0; Time.timeScale = 1; AutoFade.LoadLevel(0, 1f, 1f, Color.black); } if (GUI.Button(new Rect(590, 160, 80, 20), "Resume")) { pause = false; counts = 0; Time.timeScale = 1; } } } }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; }
private void Awake() { DontDestroyOnLoad(this); _instance = this; _material = new Material("Shader \"Plane/No zTest\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off Fog { Mode Off } BindChannels { Bind \"Color\",color } } } }"); }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; m_Material = (Material)Resources.Load("FaderShader");//new Material("Shader \"Plane/ZTest Off\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off Fog { Mode Off } BindChannels { Bind \"Color\",color } } } }"); }
private void Awake() { DontDestroyOnLoad(this); m_Instance = this; m_Material = new Material(Shader.Find("ELO/AutoFade")); }