void Awake() { if (instance == null) instance = this; else DestroyImmediate(this); }
private void InitializationAllObjects() { loadScript = GameObject.Find("GameManager").GetComponent <LoadScript>(); searchInputField = GameObject.Find("SearchInputField"); GameObject changeSceneButton = GameObject.Find("ChangeSceneButton"); changeSceneButton.transform.GetChild(0).GetComponent <Text>().text = scene; }
void Start() { if (LoadPath == null) { Seed = Random.Range(0, 10000); mainTexture = new RenderTexture(MAP_SIZE, MAP_SIZE, 0, RenderTextureFormat.ARGBFloat) { anisoLevel = 0, enableRandomWrite = true, autoGenerateMips = false, filterMode = FilterMode.Point }; mainTexture.Create(); mainTexturePrevFrame = new RenderTexture(mainTexture.width, mainTexture.height, 0, RenderTextureFormat.ARGBFloat) { anisoLevel = 0, enableRandomWrite = true, autoGenerateMips = false, filterMode = FilterMode.Point }; mainTexturePrevFrame.Create(); } else { LoadSaveState = LoadScript.LoadSaveState(Path.Combine(LoadPath, SaveUtilities.StatFileName)); var loadTexture = LoadScript.LoadTextureData(Path.Combine(LoadPath, SaveUtilities.MapFileName)); mainTexture = LoadScript.FromTexture2D(loadTexture); mainTexturePrevFrame = LoadScript.FromTexture2D(loadTexture); Seed = LoadSaveState.Seed; } shadowTexture = new RenderTexture(mainTexture.width, mainTexture.height, 0, RenderTextureFormat.ARGBFloat) { anisoLevel = 0, enableRandomWrite = true, autoGenerateMips = false, filterMode = FilterMode.Bilinear }; shadowTexture.Create(); PlaceShader.SetInt("seed", Seed); ParticleShader.SetInt("seed", Seed); BeltShader.SetInt("seed", Seed); SetupShaderTextures(); if (LoadPath == null) { GenerateMap(); } ShadowShader.Dispatch(1, 1, 1, 1); ClassManager.MainScript = this; ClassManager.MapReadService = new MapReadService(); }
private void Awake() { loader = this; savePath = Application.persistentDataPath + "/RoboHeist.dat"; if (sceneName != SceneManager.GetActiveScene().name) { sceneName = SceneManager.GetActiveScene().name; } }
private void InitializationAllObjects() { gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); loadScript = GameObject.Find("GameManager").GetComponent <LoadScript>(); typeOfItemsInputField = transform.gameObject.GetComponent <InputField>(); saveButton = GameObject.Find("CreateNewTypeButton").GetComponent <Button>(); }
/// <summary> /// Operations performed before the serialization /// </summary> public void BeforeSerialization() { InitParameters(); _tempParameters = Parameters.ToList(); //Remove parameters identical to config Parameters.RemoveAll(i => i.Value == null || i.Value == i.ConfigValue); if (DefinitionScript != null && DefinitionScript.Trim().Replace("\r\n", "\n") == DefaultDefinitionScript.Trim().Replace("\r\n", "\n")) DefinitionScript = null; if (LoadScript != null && LoadScript.Trim().Replace("\r\n", "\n") == DefaultLoadScript.Trim().Replace("\r\n", "\n")) LoadScript = null; }
private void InitializationAllItems() { gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); loadScript = GameObject.Find("GameManager").GetComponent <LoadScript>(); itemImage = transform.GetChild(1).GetComponent <Image>(); nameOfItemForBuyText = transform.GetChild(2).GetComponent <Text>(); buttonsToSize = transform.GetChild(3).gameObject; plusButton = transform.GetChild(5).GetComponent <Button>(); minusButton = transform.GetChild(6).GetComponent <Button>(); countOfItemToBuy = transform.GetChild(7).GetComponent <Text>(); summIntText = transform.GetChild(9).GetComponent <Text>(); }
void Start() { anim = this.GetComponent <Animation>(); audioSource = this.GetComponent <AudioSource>(); GameObject LoadScriptObject = GameObject.FindGameObjectWithTag("Door"); if (LoadScriptObject != null) { ls = LoadScriptObject.GetComponent <LoadScript>(); } UpdatePosition(); }
private void Start() { frame = 0; m_state = EState.InitDisplayLoad; BgmSet(); fadeController = FindObjectOfType <FadeController>(); m_stageCreater = FindObjectOfType <StageCreate>(); m_LoadCreater = FindObjectOfType <LoadCreate>(); m_LoadScript = FindObjectOfType <LoadScript>(); armatureSave = FindObjectOfType <ArtArmatureSave>(); MaxPlayer = DebugModeGame.GetProperty().m_debugMode ? DebugModeGame.GetProperty().m_debugPlayerNum : 6; StDownflg = false; }
private void InitializationAllItems() { gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); loadScript = GameObject.Find("GameManager").GetComponent <LoadScript>(); imageScrollViewForItem = GameObject.Find("ImageScrollViewForItem"); ownInfoAboutItem = GameObject.Find("OwnInfoAboutItem"); firstCostText = ownInfoAboutItem.transform.GetChild(0).gameObject; secondCostText = ownInfoAboutItem.transform.GetChild(1).gameObject; nameItemText = ownInfoAboutItem.transform.GetChild(2).gameObject; briefInfoOfItemText = ownInfoAboutItem.transform.GetChild(3).gameObject; compositionOfItemText = ownInfoAboutItem.transform.GetChild(4).gameObject; manufacturingFirmText = ownInfoAboutItem.transform.GetChild(5).gameObject; contentForSizes = ownInfoAboutItem.transform.GetChild(6).gameObject; }
private void InitializationAllObjects() { loadScript = GameObject.Find("GameManager").GetComponent <LoadScript>(); mobileNotificationAndroidScript = GameObject.Find("GameManager").GetComponent <MobileNotificationAndroidScript>(); loadPersonInfoFromFilesScript = GameObject.Find("GameManager").GetComponent <LoadPersonInfoFromFilesScript>(); lowerPanel = GameObject.Find("LowerPanelWithButton"); topPanel = GameObject.Find("TopPanelWithShopName"); searchPanel = topPanel.transform.GetChild(1).gameObject.GetComponent <InputField>(); helpMessageText = GameObject.Find("HelpMessageText").GetComponent <Text>(); helpMessageText.gameObject.SetActive(false); loadingWindow = GameObject.Find("LoadingWindow"); loadingWindow.gameObject.SetActive(false); }
//read the file to make the spheres public void loadSpheres(string fileName) { Stack <string> stack = new Stack <string>(); stack.Push(Application.dataPath); string saveLocation = ""; while (stack.Count > 0) { string currentDir = stack.Pop(); foreach (string dir in Directory.GetDirectories(currentDir)) { if (Path.GetFileName(dir).Equals(fileName)) { saveLocation = dir; } stack.Push(dir); } } string vector; createSphere = FindObjectOfType <LoadScript>(); Debug.Log(System.IO.File.Exists(saveLocation + "/" + fileName)); load = System.IO.File.ReadAllLines(saveLocation + "/" + fileName); Debug.Log(System.IO.File.Exists(saveLocation + "/" + fileName)); foreach (string line in load) { vector = line.Substring(0, line.IndexOf(")") + 1); sphereName = line.Substring(line.IndexOf(")") + 2); vec = StringToVector3(vector); createSphere.startSphere(); } createSphere.spheresMade(); }
/// <summary> /// Helper to check if the 2 MetaTable have the same definition /// </summary> public bool IsIdentical(MetaTable table) { bool result = TemplateName == table.TemplateName && DefinitionScript.Trim() == table.DefinitionScript.Trim() && (LoadScript == null && table.LoadScript == null) || (LoadScript.Trim() == table.LoadScript.Trim()) ; if (result) { foreach (var parameter in Parameters) { if (parameter.Value != table.GetValue(parameter.Value)) { result = false; break; } } } return(result); }
public Main(string client, CookieContainer cookieContainer) { InitializeComponent(); this.ActiveControl = label1; _interval = GetInterval(); _serverUrl = ConfigurationManager.AppSettings[Constants.ServerUrl]; _client = client; _cookieContainer = cookieContainer; _loadScript = LoadScript.GetInstance(); _mainScript = new MainScript(); _worker = new BackgroundWorker(); _worker.DoWork += _worker_DoWork; _worker.RunWorkerCompleted += _worker_RunWorkerCompleted; _worker.WorkerSupportsCancellation = true; SetConnection(); FormClosed += Main_FormClosedAsync; Load += Main_Load; toolStripMenuItem1.Click += ToolStripMenuItem1_Click; toolStripMenuItem2.Click += ToolStripMenuItem2_Click; toolStripMenuItem3.Click += ToolStripMenuItem3_Click; this.Text = $"{_client} - target server: {_serverUrl}"; }
private void InitializationAllItems() { gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); loadScript = GameObject.Find("GameManager").GetComponent <LoadScript>(); }
public bool end = false; //!< to remember if we are done reading new waves from a script /** * Use this for initialization * Check if game was loaded properly. If not reload. * Start spawning waves. */ void Start() { level = null; // initially set the reference to null GameObject counter = GameObject.Find("ChooseBackground"); // try to find an instance of the background chooser if (counter != null) // if the counter is not null we can continue as normal with initialization { // if the counter was there we can just get the level level = counter.GetComponent <SmallIntestineLoadLevelCounter> (); } else // if we start the level from the game itself just start at level 0, 1, or 2 appropriately { // this part should only happen if we start the game from the wrong scene in the unity editor // if the counter wasn't there reload properly // this will reload the entire game from the level it was supposed to be loaded from if (Application.loadedLevelName == "SmallIntestineTutorial") { // if we load directly from the tutorial scene, then reload the si game from level 0 PlayerPrefs.SetInt("DesiredSILevel", 0); PlayerPrefs.Save(); Application.LoadLevel("LoadLevelSmallIntestine"); } else if (Application.loadedLevelName == "SmallIntestineOdd") { // if we load directly from the si odd scene, then reload the si game from level 1 PlayerPrefs.SetInt("DesiredSILevel", 1); PlayerPrefs.Save(); Application.LoadLevel("LoadLevelSmallIntestine"); } else if (Application.loadedLevelName == "SmallIntestineEven") { // if we load directly from the si even scene, then reload the game from level 2 PlayerPrefs.SetInt("DesiredSILevel", 2); PlayerPrefs.Save(); Application.LoadLevel("LoadLevelSmallIntestine");; } } // load in the script info if (counter != null) // guard check to prevent this code from executing before the game is reloaded { // start loading in the script loadScript = new LoadScript(); // create a new script loader //if (!level.getTutorial ()) { //if not tutorial waves = loadScript.loadIntestineLevel(level.getLevel(), level.isTutorial(), level.getTutorialNum()); // get the waves for the correct script currentWave = 0; // set the current wave index to 0 waveDelay = waves[0].startDelay; // get the start delay from the first parsed wave waveTime = waves[0].runTime; // get the run time from the first parsed wave SpawnInterval = waves[0].nutrientSpawnInterval; // get the nutrient spawn interval from the first parsed wave speed = waves[0].nutrientSpeed; // get the nutrient speed from the first parsed wave availableColors = waves[0].colors; // get the colors for the first parsed wave minNutrients = waves[0].minBlobs; // get the min blobs for the first parsed wave maxNutrients = waves[0].maxBlobs; // get the max blobs for the first parsed wave m_TimeSinceLastSpawn = 0f; // start the timesincelastspawn variable to 0 } // we don't use debug config in the tutorial level so check that we aren't in the tutorial level before // we look for a reference to the debugger to get the debug script if (Application.loadedLevelName != "SmallIntestineTutorial") { debugConfig = ((GameObject)GameObject.Find("Debug Config")).GetComponent <DebugConfig>(); } }