Inheritance: SRPGCKEditor
    private void LoadBulletData()
    {
        if (_equipmentEditor == null)
        {
            _equipmentEditor = gameObject.AddComponent <EquipmentEditor>();
        }

        _equipmentEditor.Load();

        for (int i = 0; i < 5; ++i)
        {
            _bulletEditor._bulletData._name = _equipmentEditor._equipmentData.bullets[i];
            _bulletEditor.Load();
            _createBullet.SetBulletData(_bulletEditor._bulletData);
            _createBullet._poolObjectsToList = _player.Find("Gun").transform.GetChild(i).GetComponent <PoolObjectsToList>();
            _createBullet.Generate();
        }
    }
Exemple #2
0
        public void Write(AppearanceEditor ap, EquipmentEditor eq, SaveModes mode)
        {
            if (mode.HasFlag(SaveModes.EquipmentGear))
            {
                if (this.MainHand?.ModelSet != 0)
                {
                    this.MainHand?.Write(eq.MainHand);
                }

                this.OffHand?.Write(eq.OffHand);
                this.HeadGear?.Write(eq.Head);
                this.Body?.Write(eq.Body);
                this.Hands?.Write(eq.Hands);
                this.Legs?.Write(eq.Legs);
                this.Feet?.Write(eq.Feet);

                Write(this.MainHandScale, (v) => eq.MainHand.Scale = v);
                Write(this.MainHandColor, (v) => eq.MainHand.Color = v);
                Write(this.OffHandScale, (v) => eq.OffHand.Scale   = v);
                Write(this.OffHandColor, (v) => eq.OffHand.Color   = v);
            }

            if (mode.HasFlag(SaveModes.EquipmentAccessories))
            {
                this.Ears?.Write(eq.Ears);
                this.Neck?.Write(eq.Neck);
                this.Wrists?.Write(eq.Wrists);
                this.LeftRing?.Write(eq.LeftRing);
                this.RightRing?.Write(eq.RightRing);
            }

            if (mode.HasFlag(SaveModes.AppearanceHair))
            {
                Write(this.Hair, (v) => ap.Appearance.Hair = v);
                Write(this.EnableHighlights, (v) => ap.Appearance.EnableHighlights = v);
                Write(this.HairTone, (v) => ap.Appearance.HairTone     = v);
                Write(this.Highlights, (v) => ap.Appearance.Highlights = v);

                ap.HairTint      = this.HairTint;
                ap.HairGlow      = this.HairGlow;
                ap.HighlightTint = this.HighlightTint;
            }

            if (mode.HasFlag(SaveModes.AppearanceFace) || mode.HasFlag(SaveModes.AppearanceBody))
            {
                Write(this.Race, (v) => ap.Appearance.Race     = v);
                Write(this.Gender, (v) => ap.Appearance.Gender = v);
                Write(this.Tribe, (v) => ap.Appearance.Tribe   = v);
                Write(this.Age, (v) => ap.Appearance.Age       = v);
            }

            if (mode.HasFlag(SaveModes.AppearanceFace))
            {
                Write(this.Head, (v) => ap.Appearance.Head                     = v);
                Write(this.REyeColor, (v) => ap.Appearance.REyeColor           = v);
                Write(this.FacialFeatures, (v) => ap.Appearance.FacialFeatures = v);
                Write(this.LimbalEyes, (v) => ap.Appearance.LimbalEyes         = v);
                Write(this.Eyebrows, (v) => ap.Appearance.Eyebrows             = v);
                Write(this.LEyeColor, (v) => ap.Appearance.LEyeColor           = v);
                Write(this.Eyes, (v) => ap.Appearance.Eyes                     = v);
                Write(this.Nose, (v) => ap.Appearance.Nose                     = v);
                Write(this.Jaw, (v) => ap.Appearance.Jaw     = v);
                Write(this.Mouth, (v) => ap.Appearance.Mouth = v);
                Write(this.LipsToneFurPattern, (v) => ap.Appearance.LipsToneFurPattern = v);
                Write(this.FacePaint, (v) => ap.Appearance.FacePaint           = v);
                Write(this.FacePaintColor, (v) => ap.Appearance.FacePaintColor = v);

                ap.LeftEyeColor    = this.LeftEyeColor;
                ap.RightEyeColor   = this.RightEyeColor;
                ap.LimbalRingColor = this.LimbalRingColor;
                ap.LipTint         = this.LipTint;
            }

            if (mode.HasFlag(SaveModes.AppearanceBody))
            {
                Write(this.Height, (v) => ap.Appearance.Height     = v);
                Write(this.Skintone, (v) => ap.Appearance.Skintone = v);
                Write(this.EarMuscleTailSize, (v) => ap.Appearance.EarMuscleTailSize = v);
                Write(this.TailEarsType, (v) => ap.Appearance.TailEarsType           = v);
                Write(this.Bust, (v) => ap.Appearance.Bust = v);

                ap.SkinTint = this.SkinTint;
                ap.SkinGlow = this.SkinGlow;
            }
        }
    void Awake()
    {
        if (s_self == null)
        {
            s_self = this;
        }
        else
        {
            if (s_self != null)
            {
                Destroy(gameObject);
                return;
            }
        }

#if !UNITY_EDITOR
        m_bIsEditor  = false;
        m_bIsEditorX = false;
        foreach (var item in System.Environment.GetCommandLineArgs())
        {
            if (item.Equals("Editor"))
            {
                m_bIsEditor = true;
            }

            if (item.Equals("EditorXXL"))
            {
                m_bIsEditorX = true;
            }
        }
#endif

        if (m_bIsEditorX)
        {
            GameObject    tmp  = Instantiate(Resources.Load(m_strEquipmentInformationOutline) as GameObject, transform) as GameObject;
            RectTransform rect = tmp.GetComponent <RectTransform>();
            rect.anchorMin         = new Vector2(0, 0);
            rect.anchorMax         = new Vector2(0, 1);
            rect.offsetMin         = new Vector2(0, 0);
            rect.offsetMax         = new Vector2(200, 0);
            m_equipmentInfoOutline = tmp.GetComponent <EquipmentInfoOutline>();
            if (m_equipmentInfoOutline != null)
            {
                m_equipmentInfoOutline = GetComponentInChildren <EquipmentInfoOutline>();
            }
            m_equipmentInfoOutline.onClick.AddListener((string _arg0) =>
            {
                ShowPnlEquipmentInfo(_arg0);
            });


            tmp                   = Instantiate(Resources.Load(m_strEquipmentInformationEditor) as GameObject, transform) as GameObject;
            rect                  = tmp.GetComponent <RectTransform>();
            rect.anchorMin        = new Vector2(0.5f, 1);
            rect.anchorMax        = new Vector2(0.5f, 1);
            m_equipmentInfoEditor = tmp.GetComponent <EquipmentEditor>();
            m_equipmentInfoEditor.onNewXinfo.AddListener(() =>
            {
                OnAddElement();
            });
            m_equipmentInfoEditor.onOpenXinfo.AddListener(() =>
            {
                var extensions = new[] { new ExtensionFilter("设备信息", "xinfo"), };
                string[] path  = StandaloneFileBrowser.OpenFilePanel("Open File", Application.streamingAssetsPath + "/equipment", extensions, false);
                if (path.Length > 0)
                {
                    if (string.IsNullOrEmpty(path[0]))
                    {
                    }
                    else
                    {
                        ShowPnlEquipmentInfoByPath(path[0]);
                    }
                }
            });
        }


        if (m_dicEquipmentInfo == null)//初始化一个字典,防止后面时候的时候为空
        {
            m_dicEquipmentInfo = new Dictionary <string, EquipmentInfo>();
        }
    }
Exemple #4
0
        public void Read(AppearanceEditor ed, EquipmentEditor eq, SaveModes mode)
        {
            if (mode.HasFlag(SaveModes.EquipmentGear))
            {
                this.MainHand      = new Weapon(eq.MainHand);
                this.MainHandScale = eq.MainHand.Scale;
                this.MainHandColor = eq.MainHand.Color;

                this.OffHand      = new Weapon(eq.OffHand);
                this.OffHandScale = eq.OffHand.Scale;
                this.OffHandColor = eq.OffHand.Color;

                this.HeadGear = new Item(eq.Head);
                this.Body     = new Item(eq.Body);
                this.Hands    = new Item(eq.Hands);
                this.Legs     = new Item(eq.Legs);
                this.Feet     = new Item(eq.Feet);
            }

            if (mode.HasFlag(SaveModes.EquipmentAccessories))
            {
                this.Ears      = new Item(eq.Ears);
                this.Neck      = new Item(eq.Neck);
                this.Wrists    = new Item(eq.Wrists);
                this.LeftRing  = new Item(eq.LeftRing);
                this.RightRing = new Item(eq.RightRing);
            }

            if (mode.HasFlag(SaveModes.AppearanceHair))
            {
                this.Hair             = ed.Appearance.Hair;
                this.EnableHighlights = ed.Appearance.EnableHighlights;
                this.HairTone         = ed.Appearance.HairTone;
                this.Highlights       = ed.Appearance.Highlights;
                this.HairTint         = ed.HairTint;
                this.HairGlow         = ed.HairGlow;
                this.HighlightTint    = ed.HighlightTint;
            }

            if (mode.HasFlag(SaveModes.AppearanceFace) || mode.HasFlag(SaveModes.AppearanceBody))
            {
                this.Race   = ed.Appearance.Race;
                this.Gender = ed.Appearance.Gender;
                this.Tribe  = ed.Appearance.Tribe;
                this.Age    = ed.Appearance.Age;
            }

            if (mode.HasFlag(SaveModes.AppearanceFace))
            {
                this.Head               = ed.Appearance.Head;
                this.REyeColor          = ed.Appearance.REyeColor;
                this.LimbalEyes         = ed.Appearance.LimbalEyes;
                this.FacialFeatures     = ed.Appearance.FacialFeatures;
                this.Eyebrows           = ed.Appearance.Eyebrows;
                this.LEyeColor          = ed.Appearance.LEyeColor;
                this.Eyes               = ed.Appearance.Eyes;
                this.Nose               = ed.Appearance.Nose;
                this.Jaw                = ed.Appearance.Jaw;
                this.Mouth              = ed.Appearance.Mouth;
                this.LipsToneFurPattern = ed.Appearance.LipsToneFurPattern;
                this.FacePaint          = ed.Appearance.FacePaint;
                this.FacePaintColor     = ed.Appearance.FacePaintColor;
                this.LeftEyeColor       = ed.LeftEyeColor;
                this.RightEyeColor      = ed.RightEyeColor;
                this.LimbalRingColor    = ed.LimbalRingColor;
                this.LipTint            = ed.LipTint;
            }

            if (mode.HasFlag(SaveModes.AppearanceBody))
            {
                this.Height            = ed.Appearance.Height;
                this.Skintone          = ed.Appearance.Skintone;
                this.EarMuscleTailSize = ed.Appearance.EarMuscleTailSize;
                this.TailEarsType      = ed.Appearance.TailEarsType;
                this.Bust     = ed.Appearance.Bust;
                this.SkinTint = ed.SkinTint;
                this.SkinGlow = ed.SkinGlow;
            }
        }