Пример #1
0
        internal void afterDraw()
        {
            for (int i = 0; i < components.Count; i++)
            {
                if (components[i] is Behavior)
                {
                    Behavior beh = (Behavior)components[i];

                    if (beh.enabled)
                    {
                        if (beh.isMethodExists("afterDraw"))
                        {
                            beh.call("afterDraw");
                        }
                    }
                }
                else if (components[i] is BlueprintBehavior)
                {
                    BlueprintBehavior beh = (BlueprintBehavior)components[i];

                    if (beh.blueprint != null && beh.enabled)
                    {
                        beh.blueprint.afterDraw();
                    }
                }
            }
        }
Пример #2
0
        public override Component clone()
        {
            BlueprintBehavior b = new BlueprintBehavior();
            b.blueprint = blueprint;
            b.enabled = enabled;

            return b;
        }
Пример #3
0
        public override Component clone()
        {
            BlueprintBehavior b = new BlueprintBehavior();

            b.blueprint = blueprint;
            b.enabled   = enabled;

            return(b);
        }
Пример #4
0
        public PropertyDescriptorCollection GetProperties()
        {
            PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null);
            Dictionary <string, object>  d   = new Dictionary <string, object>();

            for (int i = 0; i < this.List.Count; i++)
            {
                string n = this.List[i].GetType().Name;

                switch (this.List[i].GetType().Name)
                {
                case "Behavior":
                    Behavior b = (Behavior)this.List[i];
                    if (b.script != null)
                    {
                        n = b.script.name;
                    }
                    break;

                case "BlueprintBehavior":
                    BlueprintBehavior bb = (BlueprintBehavior)this.List[i];
                    if (bb.blueprint != null)
                    {
                        n = bb.blueprint.name;
                    }
                    break;
                }

                int it = 0;

                foreach (string k in d.Keys)
                {
                    if (k.Equals(n) || k.Equals(n + " (" + it.ToString() + ")"))
                    {
                        it += 1;
                    }
                }
                if (it > 0)
                {
                    n += " (" + it.ToString() + ")";
                }

                d.Add(n, this.List[i]);

                CollectionPropertyDescriptor pd = new CollectionPropertyDescriptor(d, i);
                pds.Add(pd);
            }

            return(pds);
        }