Beispiel #1
0
        public static BComponent BuildComponent(XmlNode xmlDoc, BComponent parent, Behaviors behavior)
        {
            string name = xmlDoc.Name;

            if (ActionBool.NAME == name)
            {
                return(ActionBool.Build(xmlDoc, parent, behavior));
            }
            else if (ActionProperty.NAME == name)
            {
                return(ActionProperty.Build(xmlDoc, parent, behavior));
            }
            else if (ActionVoid.NAME == name)
            {
                return(ActionVoid.Build(xmlDoc, parent, behavior));
            }
            else if (ActionEnumerator.NAME == name)
            {
                return(ActionEnumerator.Build(xmlDoc, parent, behavior));
            }
            else if (RandomSelector.NAME == name)
            {
                return(RandomSelector.Build(xmlDoc, parent, behavior));
            }
            else if (RootSelector.NAME == name)
            {
                return(RootSelector.Build(xmlDoc, parent, behavior));
            }
            else if (Selector.NAME == name)
            {
                return(Selector.Build(xmlDoc, parent, behavior));
            }
            else if (Sequence.NAME == name)
            {
                return(Sequence.Build(xmlDoc, parent, behavior));
            }
            else if (Inverter.NAME == name)
            {
                return(Inverter.Build(xmlDoc, parent, behavior));
            }
            else if (UntilTrue.NAME == name)
            {
                return(UntilTrue.Build(xmlDoc, parent, behavior));
            }
            else if (UntilFalse.NAME == name)
            {
                return(UntilFalse.Build(xmlDoc, parent, behavior));
            }
            else
            {
                Debug.LogErrorFormat("I did not find the item: {0}", name);
                return(null);
            }
        }