Hello i’m new on Cocos Creator and also type script.
I’m trying to make array of class but i couldn’t done it. Because of the simple error down below.
[Scene] Cannot read property ‘constructor’ of undefined
[Scene] Value dump failed.
When i tried to change the values o editor it resets to 0.
The code is down below;
VideoControllerData.ts;
import { Vec2, _decorator } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('VideoControllerData')
export class VideoControllerData {
@property({ type: Number })
targetTime: number = 0;
@property({type: Vec2})
targetPosition: Vec2;
}
VideoController.ts
import { _decorator, approx, Component, VideoPlayer } from 'cc';
const { ccclass, property } = _decorator;
import { VideoControllerData} from './VideoControllerData';
@ccclass('VideoController')
export class VideoController extends Component {
@property({ type: [VideoControllerData] })
videoControllerData: VideoControllerData[] = [];
}