예제 #1
0
        public void DrawLevelEditorConfiguration()
        {
            GUIContent content = new GUIContent(LevelEditorConstants.EditorConfigurationLable);
            Vector2    size    = skin.GetStyle(LevelEditorConstants.Label).CalcSize(content);

            EditorUIUtility.DrawLabel(LevelEditorConstants.EditorConfigurationLable, GUILayout.Width(size.x));
            GUILayout.Space(LevelEditorConstants.i10);
            configuration = (LevelEditorConfiguration)EditorUIUtility.DrawObjectField(configuration, typeof(LevelEditorConfiguration));
        }
        public void InitializeLevelEditorConfiguration(LevelEditorConfiguration configuration)
        {
            this.configuration = configuration;
            int toolSize   = configuration.toolConfiguration.tools.Count;
            int prefabSize = configuration.toolPrefabMapper.prefabs.Count;

            if (toolSize < prefabSize)
            {
                configuration.toolPrefabMapper.prefabs.RemoveRange(toolSize - 1, prefabSize - toolSize);
            }
            else if (toolSize > prefabSize)
            {
                List <GameObject> tempList = new List <GameObject>(toolSize - prefabSize);
                for (int indexOfGameObject = 0; indexOfGameObject < toolSize - prefabSize; indexOfGameObject++)
                {
                    tempList.Add(null);
                }
                configuration.toolPrefabMapper.prefabs.AddRange(tempList);
                Debug.Log("Inside Else");
            }
            Debug.Log("Called : " + configuration.toolPrefabMapper.prefabs.Count);
        }
예제 #3
0
 public void InitializeLevelEditorConfiguration(LevelEditorConfiguration configuration)
 {
     this.configuration = configuration;
 }