19 lines
482 B
C#
19 lines
482 B
C#
using System;
|
|
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public abstract class AiComposite : AiBehavior {
|
|
public AiBehavior[] children;
|
|
|
|
public void Add(AiBehavior behavior) {
|
|
if (children == null || children.Length == 0) {
|
|
children = new AiBehavior[1];
|
|
children[0] = behavior;
|
|
}
|
|
else {
|
|
Array.Resize(ref children, children.Length + 1);
|
|
children[children.Length - 1] = behavior;
|
|
}
|
|
}
|
|
}
|