Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] property behavior is different in v3.8 and v3.6 #18023

Open
dumganhar opened this issue Dec 10, 2024 · 0 comments
Open

[bug] property behavior is different in v3.8 and v3.6 #18023

dumganhar opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
Bug Scripting Engine bindings, script system and editor script compiler related
Milestone

Comments

@dumganhar
Copy link
Contributor

dumganhar commented Dec 10, 2024

Reported at https://forum.cocos.org/t/topic/160220

Test code:

import { _decorator } from "cc";

const { ccclass } = _decorator;

@ccclass('absTest')

export abstract class absTest<T> {

    constructor(value: T) {

        this.Update(value);

    }

    private _bbb: T;

    public get bbb(): T {

        return this._bbb;

    }

    public Update(val: T) {

        this._bbb = val;

        this.OnUpdate();

    }

    protected abstract OnUpdate(): void;

}

import { _decorator } from "cc";

import { absTest } from "./absTest";

const { ccclass } = _decorator;

@ccclass('test1')

export class test1 extends absTest<string>{

    protected OnUpdate(): void {

        this._aaa = "aaaaa";

    }

   

    private _aaa;

    public log(){

        //这里,应该输出 aaaaa,哈哈

        console.log(this._aaa,this.bbb);

    }

}
@dumganhar dumganhar added Bug Scripting Engine bindings, script system and editor script compiler related labels Dec 10, 2024
@dumganhar dumganhar added this to the 3.8.6 milestone Dec 10, 2024
@dumganhar dumganhar self-assigned this Dec 10, 2024
@dumganhar dumganhar changed the title [bug] property behavior was different in v3.8 and v3.6 [bug] property behavior is different in v3.8 and v3.6 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Scripting Engine bindings, script system and editor script compiler related
Projects
None yet
Development

No branches or pull requests

1 participant