Ejemplo n.º 1
0
        private void CreateInstance()
        {
            if (CreatedHandler == null)
            {
                return;
            }

            InstanceLocation location;

            if (_isFolderLocation)
            {
                location = _selectedFolder;
            }
            else
            {
                location = new InstancePath {
                    Path = _instancePath
                };
            }

            var instance = new LocalInstance()
            {
                Name = _name, Version = _selectedVersion, InstanceLocation = location
            };
            var args = new CreateInstanceArgs()
            {
                Instance = instance
            };

            CreatedHandler(this, args);
        }
Ejemplo n.º 2
0
        static InstancePathArray GetAllPartInstances(IntPtr po, InstancePath owners)
        {
            InstancePathArray result = new InstancePathArray();
            var current_owners       = new InstancePath(owners);

            current_owners.Add(po);

            var part = GetPartDefinition(po);

            if (IntPtr.Zero != part)
            {
                current_owners.Add(part);
                result.Add(current_owners);
                return(result);
            }

            var po_data = new A3DAsmProductOccurrenceWrapper(po);

            for (var idx = 0; idx < po_data.m_uiPOccurrencesSize; ++idx)
            {
                var child_po    = Marshal.ReadIntPtr(po_data.m_ppPOccurrences, idx * Marshal.SizeOf(typeof(IntPtr)));
                var child_paths = GetAllPartInstances(child_po, current_owners);
                result.AddRange(child_paths);
            }

            return(result);
        }
Ejemplo n.º 3
0
        public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile)
        {
            var editorInformationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData;
            var levelConfiguration     = editorInformationsData.CommonGameConfigurations.GetConfiguration <LevelConfiguration>();
            var createdAsset           = this.CreateAsset(InstancePath.GetConfigurationDataPath(levelConfiguration), editorInformationsData.LevelZonesID.ToString() + "_" + this.GetType().BaseType.GetGenericArguments()[0].Name, editorProfile);

            levelConfiguration.SetEntry(editorInformationsData.LevelZonesID, createdAsset);
            editorProfile.GameConfigurationModified(editorInformationsData.CommonGameConfigurations.GetConfiguration <LevelConfiguration>(), editorInformationsData.LevelZonesID, createdAsset);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            string exchange_folder = null;
            string input_file      = null;

            for (var arg = 0; arg < args.Length; ++arg)
            {
                if (arg < args.Length - 1)
                {
                    if (args[arg] == "--exchange")
                    {
                        exchange_folder = args[++arg];
                        continue;
                    }
                }
                input_file = args[arg];
            }

            if (null == input_file)
            {
                Console.WriteLine("Please provide an input file as an argument.");
                return;
            }


            try {
                Library.Initialize(HOOPS_LICENSE.KEY, exchange_folder);
            } catch (Library.InitializationException e) {
                Console.WriteLine(e.Message);
                return;
            }

            A3DRWParamsLoadData load_params;

            API.Initialize(out load_params);
            IntPtr model_file;

            if (A3DStatus.A3D_SUCCESS != API.A3DAsmModelFileLoadFromFile(input_file, ref load_params, out model_file))
            {
                Console.WriteLine("Failed to load input file.");
                return;
            }

            var          model_file_data = new A3DAsmModelFileWrapper(model_file);
            InstancePath owners          = new InstancePath();

            owners.Add(model_file);
            var po     = Marshal.ReadIntPtr(model_file_data.m_ppPOccurrences);
            var result = GetAllPartInstances(po, owners);

            Console.WriteLine("There are " + result.Count + " part instances.");
        }
Ejemplo n.º 5
0
        public override void OnGenerationClicked(AbstractCreationWizardEditorProfile editorProfile)
        {
            var editorInfomrationsData = editorProfile.GetModule <EditorInformations>().EditorInformationsData;

            var inherentDataClass = editorInfomrationsData.SelectedConfiguration.GetType().BaseType.GetGenericArguments()[1];

            var generateSOObjectManager = new GeneratedScriptableObjectManager <ScriptableObject>(ScriptableObject.CreateInstance(inherentDataClass),
                                                                                                  InstancePath.GetConfigurationDataPath((ScriptableObject)editorInfomrationsData.SelectedConfiguration),
                                                                                                  editorInfomrationsData.SelectedKey.ToString() + "_" + editorInfomrationsData.SelectedConfiguration.GetType().BaseType.GetGenericArguments()[0].Name);

            editorProfile.AddToGeneratedObjects(generateSOObjectManager.GeneratedAsset);

            editorInfomrationsData.SelectedConfiguration.SetEntry(editorInfomrationsData.SelectedKey, generateSOObjectManager.GeneratedAsset);
            EditorUtility.SetDirty((UnityEngine.Object)editorInfomrationsData.SelectedConfiguration);
            editorProfile.GameConfigurationModified((UnityEngine.Object)editorInfomrationsData.SelectedConfiguration, editorInfomrationsData.SelectedKey, generateSOObjectManager.GeneratedAsset);
        }
Ejemplo n.º 6
0
        private void CreateInstance()
        {
            if (CreatedHandler == null)
                return;

            InstanceLocation location;
            if (_isFolderLocation)
            {
                location = _selectedFolder;
            }
            else
            {
                location = new InstancePath { Path = _instancePath };
            }
                
            var instance = new LocalInstance() { Name = _name, Version = _selectedVersion, InstanceLocation = location };
            var args = new CreateInstanceArgs() { Instance = instance };
            CreatedHandler(this, args);
        }
 public override bool Equals(object obj)
 {
     return(obj is ValidationError error &&
            InstancePath.SequenceEqual(error.InstancePath) &&
            SchemaPath.SequenceEqual(error.SchemaPath));
 }