コード例 #1
0
        public static BTState Create(BTFsm parentFsm, System.Type type)
        {
            var newState = XScriptableObject.CreateInstance(type) as BTState;

            newState.Owner = parentFsm;
            parentFsm.AddNewState(newState);
            return(newState);
        }
コード例 #2
0
        public static BTState Create <T>(BTFsm parentFsm) where T : BTState
        {
            var newState = XScriptableObject.CreateInstance <T>();

            newState.Owner = parentFsm;
            parentFsm.AddNewState(newState);
            return(newState);
        }