コード例 #1
0
        static Fireable GetLowestChild(Fireable fireable)
        {
            var last = fireable;

            while (fireable != null)
            {
                last     = fireable;
                fireable = fireable.Child as Fireable;
            }
            return(last);
        }
コード例 #2
0
        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);
        }
コード例 #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]);
        }
コード例 #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
        }