示例#1
0
 public void toggleShowMountsOnly(bool v)
 {
     mountsOnly = v;
     if (!v)
     {
         updateComboBoxDataModel();
         changeNif("crucia.nif");
         animationNif.setActiveAnimation(animationNif.getIdleAnimIndex());
     }
     else
     {
         updateComboBoxDataModel();
     }
 }
示例#2
0
    public void changeNif(string newNifP)
    {
        try
        {
            Debug.Log("Change nif:" + newNifP);
            string newNif = newNifP;
            if (newNifP.Contains(":"))
            {
                newNif = newNifP.Split(':')[1];
            }
            Model       animNifModel = nifDictionary[newNif];
            AnimatedNif animNif      = gameObject.GetComponent <AnimatedNif>();
            if (animNif == null)
            {
                animNif = gameObject.AddComponent <AnimatedNif>();
            }
            animNif.setParams(adb, animNifModel.nifFile, animNifModel.kfmFile, animNifModel.kfbFile);
            this.mount = animNifModel.mount;
            if (nifmodel != null)
            {
                GameObject.DestroyImmediate(nifmodel);
            }
            Debug.Log("load nif");

            nifmodel = NIFLoader.loadNIF(animNif.nif, true);
            nifmodel.transform.parent = root.transform;

            Debug.Log("set anims dropdown");
            this.animationDropdown.ClearOptions();
            List <String> anims = new List <String>();
            foreach (KFAnimation ani in animNif.getAnimations())
            {
                //Debug.Log("Found anim [" + ani.id + "]:" + ani.sequenceFilename + ":" + ani.sequencename );
                anims.Add(ani.sequencename);
            }
            anims.Sort();
            Debug.Log("set skel root");
            animNif.setSkeletonRoot(nifmodel);
            animationNif = animNif;
            Debug.Log("set active anim");
            animationNif.setActiveAnimation(animationNif.getIdleAnimIndex());

            this.animationDropdown.AddOptions(anims);
            Debug.Log("DONE Change nif:" + newNifP);
        }
        catch (Exception ex)
        {
            Debug.LogError(ex);
        }
    }