示例#1
0
    private void updateComboBoxDataModel()
    {
        if (cachedNifEntries == null)
        {
            IEnumerable <entry> entries = db.getEntriesForID(7305);

            List <string> nIFModelEntries = new List <string>();
            List <entry>  lentries        = new List <entry>(entries);

            nIFModelEntries.Clear();
            nifDictionary.Clear();

            foreach (entry e in lentries)
            {
                try
                {
                    Model model = AnimatedModelLoader.load7305(adb, e.key);
                    if (model != null)
                    {
                        string nifFile = model.nifFile;
                        if (!model.mount && mountsOnly)
                        {
                            continue;
                        }
                        if (model.animated)
                        {
                            if (!nifDictionary.ContainsKey(nifFile))
                            {
                                nIFModelEntries.Add(model.displayname);
                                nifDictionary[nifFile] = model;
                                //new AnimatedNif(adb, nifFile, model.kfmFile, model.kfbFile);
                            }
                        }
                        else
                        {
                            // normal model
                            if (!nifDictionary.ContainsKey(nifFile))
                            {
                                nifDictionary[nifFile] = model;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Debug.Log("Unable to parse entry " + e.id + ":" + e.key + ":" + ex.Message);
                }
            }
            cachedNifEntries = nIFModelEntries;
        }
        nIFModelDropdown.GetComponent <FavDropDown2>().SetOptions(cachedNifEntries.Where(x =>
        {
            if (filter != null && filter.Length > 0)
            {
                return(x.Contains(filter));
            }
            return(true);
        }).Select(x => new DOption(x, null, false)).ToList());
    }
示例#2
0
    void handleMount()
    {
        if (mount == null)
        {
            int    key   = ProgramSettings.get("MOUNT_KEY", 1445235995); // dragon mount default
            string anim  = ProgramSettings.get("MOUNT_ANIM", "mount_dragon_jump_cycle");
            float  speed = ProgramSettings.get("MOUNT_ANIM_SPEED", 0.02f);
            mount = AnimatedModelLoader.loadNIF(key);
            AnimatedNif animNif = mount.GetComponent <AnimatedNif>();
            animNif.animSpeed = speed;
            animNif.setSkeletonRoot(mount);
            animNif.setActiveAnimation(anim);
            //mount.transform.parent = mcamera.transform;

            mount.transform.position = this.mcamera.transform.position;
            mount.transform.rotation = this.mcamera.transform.rotation;
            // human_female_mount_dragon_jump_cycle.kf

            GameObject character = new GameObject();

            Paperdoll mainPaperdoll = character.AddComponent <Paperdoll>();
            mainPaperdoll.animOverride = anim;
            mainPaperdoll.kfbOverride  = "human_female_mount.kfb";
            mainPaperdoll.setGender("female");
            mainPaperdoll.setRace("human");
            //mainPaperdoll.GetComponent<AnimatedNif>().animSpeed = 0.02f;
            mainPaperdoll.animSpeed               = speed;
            character.transform.parent            = mount.transform;
            character.transform.localPosition     = new Vector3(0, 0, 0);
            character.transform.localRotation     = Quaternion.identity;
            mainPaperdoll.transform.localRotation = Quaternion.identity;

            mainPaperdoll.setAppearenceSet(-57952362);

            this.mcamera.GetComponent <cam.camera_movement>().enabled = false;
            mount_movement mm = mount.AddComponent <mount_movement>();
            mm.source = mount;

            this.mcamera.GetComponent <Mount_Camera>().enabled = true;
            this.mcamera.GetComponent <Mount_Camera>().target  = mount.transform;
        }
        else
        {
            DestroyChildren(mount.transform);
            GameObject.Destroy(mount);
            mount = null;
            this.mcamera.GetComponent <cam.camera_movement>().enabled = true;
            this.mcamera.GetComponent <Mount_Camera>().enabled        = false;
        }
    }