private void OnValidate()
 {
     if (Instance != null)
     {
         regenerate.Invoke();
         Debug.Log("OnValidate is Called!");
     }
 }
示例#2
0
 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)));
 }
示例#3
0
        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);
        }
示例#4
0
        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();
        }
示例#5
0
        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;
        }
示例#6
0
 public static void InvokeGenerate(LSystemController lsysController) => OnGenerate?.Invoke(lsysController);