forked from a1967629423/puerts-react-umg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTsTestActor.ts
121 lines (81 loc) · 2.36 KB
/
TsTestActor.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import * as UE from 'ue'
import {rpc, edit_on_instance} from 'ue'
console.warn("Script init of TsTestActor ");
class TsTestActor extends UE.Actor {
tickCount: number;
actor: UE.Actor;
cls: UE.Class;
@edit_on_instance()
b: boolean;
int64_1: BigInt;
int64_2: bigint;
str : string;
v : UE.Vector;
map: UE.TMap<string, number>;
arr: UE.TArray<UE.Object>;
set: UE.TSet<string>;
//注意,继承UE类的js类,构造函数必须大写开头
Constructor() {
this.PrimaryActorTick.bCanEverTick = true;
console.warn("TsTestActor.Constructor this.Add", this.Add(33, 44));
this.tickCount = 0;
}
//override 1
ReceiveBeginPlay(): void {
console.warn("TsTestActor.ReceiveBeginPlay this.Add", this.Add(55, 66));
}
Add(a: number, b: number): number {
return a + b;
}
GetActor() : UE.Actor {
return this.actor;
}
SetActor(p: UE.Actor) : void {
this.actor = p;
}
GetArray() : UE.TArray<UE.Object> {
return this.arr;
}
SetArray(p: UE.TArray<UE.Object>): void {
this.arr = p;
}
GetMap() :UE.TMap<string, number> {
return this.map;
}
//override 2
ReceiveTick(DeltaSeconds: number): void {
if (this.tickCount % 100 == 0) {
console.warn("TsTestActor.ReceiveTick", DeltaSeconds, this.tickCount);
}
++this.tickCount;
}
//@cpp:text
TestCppType(p1:number/*@cpp:int*/, p2:number/*@cpp:byte */): string {
return p1 + ":" + p2;
}
//@cpp:name
fname: string;
namearr: UE.TArray<string/*@cpp:text*/>;
//@no-blueprint
TsOnlyMethod():void {
}
//@no-blueprint
TsOnlyField: number;
@rpc.flags(rpc.PropertyFlags.CPF_Net | rpc.PropertyFlags.CPF_RepNotify)
@rpc.condition(rpc.ELifetimeCondition.COND_InitialOrOwner)
dint: number;
@rpc.flags(rpc.FunctionFlags.FUNC_Net | rpc.FunctionFlags.FUNC_NetClient)
Fire(): void {
}
@rpc.flags(rpc.FunctionFlags.FUNC_Net | rpc.FunctionFlags.FUNC_NetServer)
FireServer(): void {
}
OnRep_dint(): void {
}
e: UE.ETickingGroup;
ea: UE.TArray<UE.ETickingGroup>;
clsOfWidget: UE.TSubclassOf<UE.Widget>;
softObject: UE.TSoftObjectPtr<UE.Actor>;
softClass: UE.TSoftClassPtr<UE.Actor>;
}
export default TsTestActor;