public static BTState Create(BTFsm parentFsm, System.Type type) { var newState = XScriptableObject.CreateInstance(type) as BTState; newState.Owner = parentFsm; parentFsm.AddNewState(newState); return(newState); }
public static BTState Create <T>(BTFsm parentFsm) where T : BTState { var newState = XScriptableObject.CreateInstance <T>(); newState.Owner = parentFsm; parentFsm.AddNewState(newState); return(newState); }