Exemplo n.º 1
0
        internal XmlFile Upgrade()
        {
            workingTree = new XElement(xmlFile.Document);

            if (upgradePlan.RemovedElements != null)
            {
                RemoveStrategy removeStrategy = new RemoveStrategy(workingTree, upgradePlan.RemovedElements);
                removeStrategy.Execute();
            }

            if (upgradePlan.RenamedElements != null)
            {
                RenameStrategy renameStrategy = new RenameStrategy(workingTree, upgradePlan.RenamedElements);
                renameStrategy.Execute();
            }

            if (upgradePlan.AddedElements != null)
            {
                ExtensionStrategy strategy = new ExtensionStrategy(workingTree, upgradePlan.AddedElements);
                strategy.Execute();
            }

            XAttribute versionAttribute = workingTree.Attribute("version");

            if (versionAttribute == null)
            {
                workingTree.Add(new XAttribute("version", upgradePlan.UpgradeToVersion.ToString()));
            }
            else
            {
                versionAttribute.Value = upgradePlan.UpgradeToVersion.ToString();
            }

            return(new XmlFile
            {
                Document = workingTree,
                Version = upgradePlan.UpgradeToVersion
            });
        }
        void Awake()
        {
            removeStrategy          = RemoveStrategy.ClearAll;
            maxLines                = 6;
            scoreToAccept           = 0.8f;
            clearNotRecognizedLines = true;

            // MY VARS
            cam        = Camera.main;
            player     = GameObject.FindGameObjectWithTag("Player");
            recognizer = GameObject.FindGameObjectWithTag("Recognizer").GetComponent <Recognizer>();

            in3D = true;
            line.relativeSize = true;
            line.LineList     = false;
            lines             = new List <UILineRenderer>()
            {
                line
            };
            rectTransform = transform as RectTransform;
            UpdateLines();

            ClearLines();
        }