private void OnValidate() { if (Instance != null) { regenerate.Invoke(); Debug.Log("OnValidate is Called!"); } }
void Generate() { if (Count > 0) { Console.WriteLine($"{ClockTime}\t{GetType().Name}\tGenerate. Count: {Count}"); OnGenerate.Invoke(); } Count++; Schedule(Generate, TimeSpan.FromHours(Exponential.Sample(DefaultRS, 1 / HourlyRate))); }
public string GenerateBinaryTreeGraph(string name) { string imageFileName = name + ".png"; string configFileName = name + ".dot"; GenerateBinaryTreeConfigFile(configFileName); Process dot = new Process(); dot.StartInfo.FileName = "dot.exe"; dot.StartInfo.Arguments = "-Tpng -o" + imageFileName + " " + configFileName; dot.Start(); dot.WaitForExit(); OnGenerate?.Invoke(); return(imageFileName); }
private void GenerateCubeMatrix(int width, int height) { float x = -width / 2 * m_sizeOfGenerationCube.x + m_sizeOfGenerationCube.x / 2; float z = m_startPosition.position.z + m_startPosition.position.z / 2; float y = height * m_sizeOfGenerationCube.y + m_sizeOfGenerationCube.y / 2; while (z < m_distanceOfGeneration) { for (int i = 0; i < width; i++) { GenerateColumn(x, z, height); x += m_sizeOfGenerationCube.x; } z += m_sizeOfGenerationCube.z; x = -width / 2 * m_sizeOfGenerationCube.x + m_sizeOfGenerationCube.x / 2; } Instantiate(m_targetPrefab, new Vector3(m_startPosition.position.x, m_startPosition.transform.position.y, z + m_distanceBetweenLastGenerationCubeAndTarget), Quaternion.identity); OnGenerate?.Invoke(); }
public IEnumerator Generate() { lastInterruptionTime = System.DateTime.Now; fieldPoints.Clear(); combination.Clear(); GenerateRiver(); GenerateRoad(); connection.FieldConnectCreate( fieldPoints, maxRoadWidth + parameter.roadSpacing, parameter.chunkSize, parameter.numberOfChunk, parameter.riverStepSize, parameter.sugorokuMergeMulti, parameter.sugorokuOffset); DetectSurroundedAreas(); OnGenerate?.Invoke(this); yield break; }
public static void InvokeGenerate(LSystemController lsysController) => OnGenerate?.Invoke(lsysController);