forked from sunyu/CubismFramework
Fix returing value on out of index args
parent
50de62e306
commit
0ceff1c8f9
|
@ -8,6 +8,7 @@
|
||||||
import { CubismIdHandle } from '../id/cubismid';
|
import { CubismIdHandle } from '../id/cubismid';
|
||||||
import { CubismFramework } from '../live2dcubismframework';
|
import { CubismFramework } from '../live2dcubismframework';
|
||||||
import { csmString } from '../type/csmstring';
|
import { csmString } from '../type/csmstring';
|
||||||
|
import { csmVector } from '../type/csmvector';
|
||||||
import { CubismJson } from '../utils/cubismjson';
|
import { CubismJson } from '../utils/cubismjson';
|
||||||
|
|
||||||
// JSON keys
|
// JSON keys
|
||||||
|
@ -225,12 +226,12 @@ export class CubismMotionJson {
|
||||||
* @return false 存在しない
|
* @return false 存在しない
|
||||||
*/
|
*/
|
||||||
public isExistMotionCurveFadeInTime(curveIndex: number): boolean {
|
public isExistMotionCurveFadeInTime(curveIndex: number): boolean {
|
||||||
return !this._json
|
const value = this._json
|
||||||
.getRoot()
|
.getRoot()
|
||||||
.getValueByString(Curves)
|
.getValueByString(Curves)
|
||||||
.getValueByIndex(curveIndex)
|
.getValueByIndex(curveIndex)
|
||||||
.getValueByString(FadeInTime)
|
.getValueByString(FadeInTime);
|
||||||
.isNull();
|
return !(value.isNull() || value.isError());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -240,12 +241,12 @@ export class CubismMotionJson {
|
||||||
* @return false 存在しない
|
* @return false 存在しない
|
||||||
*/
|
*/
|
||||||
public isExistMotionCurveFadeOutTime(curveIndex: number): boolean {
|
public isExistMotionCurveFadeOutTime(curveIndex: number): boolean {
|
||||||
return !this._json
|
const value = this._json
|
||||||
.getRoot()
|
.getRoot()
|
||||||
.getValueByString(Curves)
|
.getValueByString(Curves)
|
||||||
.getValueByIndex(curveIndex)
|
.getValueByIndex(curveIndex)
|
||||||
.getValueByString(FadeOutTime)
|
.getValueByString(FadeOutTime);
|
||||||
.isNull();
|
return !(value.isNull() || value.isError());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -287,7 +288,7 @@ export class CubismMotionJson {
|
||||||
.getValueByString(Curves)
|
.getValueByString(Curves)
|
||||||
.getValueByIndex(curveIndex)
|
.getValueByIndex(curveIndex)
|
||||||
.getValueByString(Segments)
|
.getValueByString(Segments)
|
||||||
.getVector()
|
.getVector(new csmVector())
|
||||||
.getSize();
|
.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue