static Fireable GetLowestChild(Fireable fireable)
        {
            var last = fireable;

            while (fireable != null)
            {
                last     = fireable;
                fireable = fireable.Child as Fireable;
            }
            return(last);
        }
        public static Fireable Of(this Fireable fireable, Fireable subemitter)
        {
            if (fireable == null)
            {
                throw new ArgumentNullException("fireable");
            }
            var lowest = GetLowestChild(fireable);

            lowest.Child = subemitter;
            return(fireable);
        }
Example #3
0
        private void OnActionSelected(object t)
        {
            if (fireable == null)
            {
                fireable = (Fireable)Activator.CreateInstance(actionTypes[(string)t]);
                return;
            }

            Fireable f = fireable;

            while (f.Child != null)
            {
                f = (Fireable)f.Child;
            }

            f.Child = (Fireable)Activator.CreateInstance(actionTypes[(string)t]);
        }
Example #4
0
        private void DrawFireable(Fireable fireable)
        {
#if UNITY_EDITOR
            if (fireable == null)
            {
                return;
            }

            GUILayout.Label(fireable.GetType().Name);
            fireable.DrawInspector();

            if (fireable.Child != null)
            {
                GUILayout.Space(10);
                GUILayout.Label("Of...");
                DrawFireable((Fireable)fireable.Child);
            }
#endif
        }