Exemplo n.º 1
0
        public override bool Effect(CGObject s, Actor p1, Actor p2)
        {
            manager.CommandBufferClear();

            return(true);
        }
 protected Actor GetActor(int index, CGObject s, Actor p1, Actor p2)
 {
     return(CastToActor(GetObject(index, s, p1, p2)));
 }
Exemplo n.º 3
0
 public abstract bool Effect(CGObject s, Actor p1, Actor p2);
Exemplo n.º 4
0
        public override bool Effect(CGObject s, Actor p1, Actor p2)
        {
            Actor parent = null;

            switch (Source)
            {
            case SelectionSource.Original:
                parent = p1;
                break;

            case SelectionSource.Type:
                CGObject p = manager.CommandFindObject(source_cgtype);
                if (p is Actor)
                {
                    parent = p as Actor;
                }
                else
                {
                    return(false);
                }
                break;

            default:
                parent = null;
                return(false);
            }

            if (parent == null)
            {
                return(false);
            }

            Actor Target = null;

            switch (Mode)
            {
            case SelectionMode.Index:
                Target = parent.GetChild(target_index);
                break;

            case SelectionMode.This:
                Target = parent;
                break;

            case SelectionMode.Type:
                CGObject t = parent.FindChildren(target_cgtype);
                if (t is Actor)
                {
                    Target = t as Actor;
                }
                else
                {
                    return(false);
                }
                break;

            case SelectionMode.Random:
                return(false);
            }

            if (Target == null)
            {
                return(false);
            }

            bool all_true = true;

            foreach (Action action in children)
            {
                if (action.Run(s, Target, p2) == false)
                {
                    all_true = false;
                }
            }

            return(all_true);
        }
Exemplo n.º 5
0
 public static void Print(CGObject source, string s)
 {
     Debug.Log(source.CGType + " :: " + s);
 }
Exemplo n.º 6
0
 public static void Warning(CGObject source, string s)
 {
     Debug.LogWarning(source.CGType + " :: " + s);
 }
Exemplo n.º 7
0
 public static void Error(CGObject source, string s)
 {
     Debug.LogError(source.CGType + " :: " + s);
 }