Пример #1
0
        private void GetDataFromXmlStorage()
        {
            Debug.Log(XmlStorage.GetInt("integer", 0));
            Debug.Log(XmlStorage.GetFloat("float", 0f));
            Debug.Log(XmlStorage.Get <ExampleController.Test>("TestClass", null));
            Debug.Log(XmlStorage.Get <ExampleController.Test>("TestClass", null).str);
            Debug.Log(XmlStorage.Get <ExampleController.Test>("TestClass", null).list1.First());
            Debug.Log(XmlStorage.Get <ExampleController.Test>("TestClass", null).list1.Last());

            Debug.Log("");

            Debug.Log(XmlStorage.GetInt("del_tes1"));
            Debug.Log(XmlStorage.GetString("del_tes1"));

            Debug.Log("");

            Debug.Log(XmlStorage.GetInt("del_tes2"));
            Debug.Log(XmlStorage.GetString("del_tes2"));

            Debug.Log("");

            Debug.Log(XmlStorage.Get <string>("address"));

            Debug.Log("");

            Debug.Log(XmlStorage.Get("vec2", Vector2.zero));
            Debug.Log(XmlStorage.Get("vec3", Vector3.zero));
            Debug.Log(XmlStorage.Get("qua", Quaternion.identity).eulerAngles);

            Debug.Log("");
            Debug.Log("");
        }
Пример #2
0
        /// <summary>
        /// Initialize and load global mask settings.
        /// </summary>
        public void InitialLoad()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;
            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);

            TopMask    = new ReactiveProperty<float>(XmlStorage.Get<float>(_topMaskProp, 0f));
            BottomMask = new ReactiveProperty<float>(XmlStorage.Get<float>(_bottomMaskProp, 0f));
            LeftMask   = new ReactiveProperty<float>(XmlStorage.Get<float>(_leftMaskProp, 0f));
            RightMask  = new ReactiveProperty<float>(XmlStorage.Get<float>(_rightMaskProp, 0f));

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
Пример #3
0
        /// <summary>
        /// Load global mask settings.
        /// </summary>
        public void Load()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;
            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);

            TopMask.Value    = XmlStorage.Get<float>(_topMaskProp, 0f);
            BottomMask.Value = XmlStorage.Get<float>(_bottomMaskProp, 0f);
            LeftMask.Value   = XmlStorage.Get<float>(_leftMaskProp, 0f);
            RightMask.Value  = XmlStorage.Get<float>(_rightMaskProp, 0f);

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
        /// <summary>
        /// Load common settings.
        /// </summary>
        public void Load()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;
            XmlStorage.ChangeAggregation(XMLAggregationKey);

            NumOfColProjectors.Value = XmlStorage.Get<int>(_numOfColProjectorsProp, 1);
            NumOfRowProjectors.Value = XmlStorage.Get<int>(_numOfRowProjectorsProp, 1);
            Blackness.Value          = XmlStorage.Get<float>(_blacknessProp, 1.0f);
            Curve.Value              = XmlStorage.Get<float>(_curveProp, GAMMA_CURVE);
            Brightness.Value         = XmlStorage.Get<float>(_brightnessProp, 1.0f);
            Symmetry.Value           = XmlStorage.Get<bool>(_symmetry, true);

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
        /// <summary>
        /// Initialize and Load common settings.
        /// </summary>
        private void InitialLoad()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;
            XmlStorage.ChangeAggregation(XMLAggregationKey);

            NumOfColProjectors = new ReactiveProperty<int>(XmlStorage.Get<int>(_numOfColProjectorsProp, 1));
            NumOfRowProjectors = new ReactiveProperty<int>(XmlStorage.Get<int>(_numOfRowProjectorsProp, 1));
            Blackness          = new ReactiveProperty<float>(XmlStorage.Get<float>(_blacknessProp, 1.0f));
            Curve              = new ReactiveProperty<float>(XmlStorage.Get<float>(_curveProp, GAMMA_CURVE));
            Brightness         = new ReactiveProperty<float>(XmlStorage.Get<float>(_brightnessProp, 1.0f));
            Symmetry           = new ReactiveProperty<bool>(XmlStorage.Get<bool>(_symmetry, true));

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
Пример #6
0
        /// <summary>
        /// Load rect mask settings.
        /// </summary>
        public void Load()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;

            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);

            for (int i = 0; i < MAX_RECTMASKS; i++)
            {
                RectMaskX[i].Value      = XmlStorage.Get <float>(_rectMaskXPropPrefix + i.ToString(), 0f);
                RectMaskY[i].Value      = XmlStorage.Get <float>(_rectMaskYPropPrefix + i.ToString(), 0f);
                RectMaskWidth[i].Value  = XmlStorage.Get <float>(_rectMaskWidthPropPrefix + i.ToString(), 0f);
                RectMaskHeight[i].Value = XmlStorage.Get <float>(_rectMaskHeightPropPrefix + i.ToString(), 0f);
            }

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
Пример #7
0
        /// <summary>
        /// Initialize and Load rect mask settings.
        /// </summary>
        private void InitialLoad()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;

            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);

            for (int i = 0; i < MAX_RECTMASKS; i++)
            {
                RectMaskX[i]      = new ReactiveProperty <float>(XmlStorage.Get <float>(_rectMaskXPropPrefix + i.ToString(), 0f));
                RectMaskY[i]      = new ReactiveProperty <float>(XmlStorage.Get <float>(_rectMaskYPropPrefix + i.ToString(), 0f));
                RectMaskWidth[i]  = new ReactiveProperty <float>(XmlStorage.Get <float>(_rectMaskWidthPropPrefix + i.ToString(), 0f));
                RectMaskHeight[i] = new ReactiveProperty <float>(XmlStorage.Get <float>(_rectMaskHeightPropPrefix + i.ToString(), 0f));
            }

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
        /// <summary>
        /// Initialize and load screen settings.
        /// </summary>
        private void InitialLoad()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;

            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);

            TopBlend        = new ReactiveProperty <float>(XmlStorage.Get <float>(_topBlendProp, 0f));
            BottomBlend     = new ReactiveProperty <float>(XmlStorage.Get <float>(_bottomBlendProp, 0f));
            LeftBlend       = new ReactiveProperty <float>(XmlStorage.Get <float>(_leftBlendProp, 0f));
            RightBlend      = new ReactiveProperty <float>(XmlStorage.Get <float>(_rightBlendProp, 0f));
            topMask         = new ReactiveProperty <float>(XmlStorage.Get <float>(_topMaskProp, 0f));
            bottomMask      = new ReactiveProperty <float>(XmlStorage.Get <float>(_bottomMaskProp, 0f));
            leftMask        = new ReactiveProperty <float>(XmlStorage.Get <float>(_leftMaskProp, 0f));
            rightMask       = new ReactiveProperty <float>(XmlStorage.Get <float>(_rightMaskProp, 0f));
            topLeftMask     = new ReactiveProperty <Vector2>(XmlStorage.Get <Vector2>(_topLeftMaskProp, Vector2.zero));
            topRightMask    = new ReactiveProperty <Vector2>(XmlStorage.Get <Vector2>(_topRightMaskProp, Vector2.zero));
            bottomLeftMask  = new ReactiveProperty <Vector2>(XmlStorage.Get <Vector2>(_bottomLeftMaskProp, Vector2.zero));
            bottomRightMask = new ReactiveProperty <Vector2>(XmlStorage.Get <Vector2>(_bottomRightMaskProp, Vector2.zero));
            uvShift         = new ReactiveProperty <Vector2>(XmlStorage.Get <Vector2>(_uvShiftProp, Vector2.zero));

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
        /// <summary>
        /// Load settings.
        /// </summary>
        public void Load()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;

            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);

            TopBlend.Value        = XmlStorage.Get <float>(_topBlendProp, 0f);
            BottomBlend.Value     = XmlStorage.Get <float>(_bottomBlendProp, 0f);
            LeftBlend.Value       = XmlStorage.Get <float>(_leftBlendProp, 0f);
            RightBlend.Value      = XmlStorage.Get <float>(_rightBlendProp, 0f);
            topMask.Value         = XmlStorage.Get <float>(_topMaskProp, 0f);
            bottomMask.Value      = XmlStorage.Get <float>(_bottomMaskProp, 0f);
            leftMask.Value        = XmlStorage.Get <float>(_leftMaskProp, 0f);
            rightMask.Value       = XmlStorage.Get <float>(_rightMaskProp, 0f);
            topLeftMask.Value     = XmlStorage.Get <Vector2>(_topLeftMaskProp, Vector2.zero);
            topRightMask.Value    = XmlStorage.Get <Vector2>(_topRightMaskProp, Vector2.zero);
            bottomLeftMask.Value  = XmlStorage.Get <Vector2>(_bottomLeftMaskProp, Vector2.zero);
            bottomRightMask.Value = XmlStorage.Get <Vector2>(_bottomRightMaskProp, Vector2.zero);
            uvShift.Value         = XmlStorage.Get <Vector2>(_uvShiftProp, Vector2.zero);

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
Пример #10
0
 public static void Load()
 {
     XmlStorage ps = new XmlStorage ();
     ps.Load (Path.Combine (Defines.DATA_DIR, Defines.THEMES_FILE));
     ps.Get (ref themes);
 }
Пример #11
0
        public void Load(string file)
        {
            XmlStorage ps = new XmlStorage ();
            List <VideoProjectElement> videos = new List <VideoProjectElement> ();
            List <SlideShowProjectElement> slides = new List <SlideShowProjectElement> ();
            List <ButtonProjectElement> bts = new List <ButtonProjectElement> ();

            Logger.Debug ("Project.Load. Loading project {0}", file);
            ps.Load (file);

            Clear ();

            ps.Get <ProjectDetails> ("details", ref details);
            ps.Get <List <ButtonProjectElement>> ("buttons", ref bts);
            ps.Get <List <VideoProjectElement>> ("videos", ref videos);
            ps.Get <List <SlideShowProjectElement>> ("slides", ref slides);

            details.Filename = file; // After the details have been loaded

            foreach (Video video in videos)
                elements.Add (video);

            foreach (SlideShow slide in slides)
                elements.Add (slide);

            foreach (Button button in bts)
                buttons.Add (button);

            Logger.Debug ("Project.Load. Loaded {0} - {1} elements", Details.Filename, elements.Count);
        }