|
@@ -1,14 +1,58 @@
|
|
|
-import { _decorator, Component, Node } from 'cc';
|
|
|
-const { ccclass, property } = _decorator;
|
|
|
-
|
|
|
-@ccclass('attributes_container')
|
|
|
-export class attributes_container extends Component {
|
|
|
- start() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- update(deltaTime: number) {
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
|
|
|
+import { Attributes } from '../Attributes';
|
|
|
+import { config } from '../../config';
|
|
|
+import { widget_item } from '../widget_item';
|
|
|
+import { att_click_data, att_container } from '../../../data/data';
|
|
|
+const { ccclass, property } = _decorator;
|
|
|
+
|
|
|
+@ccclass('attributes_container')
|
|
|
+export class attributes_container extends Component {
|
|
|
+ @property(Node) btn_add_image:Node = null;
|
|
|
+ @property(Node) btn_add_animation:Node = null;
|
|
|
+ @property(Node) btn_add_drop:Node = null;
|
|
|
+ @property(Node) btn_add_click:Node = null;
|
|
|
+ @property(Node) btn_add_slide:Node = null;
|
|
|
+ @property(Prefab) item_prefab:Prefab = null;
|
|
|
+ private cur_att_manager:Attributes = null
|
|
|
+ private call_back = null;
|
|
|
+ public initView(call,att_manager:Attributes){
|
|
|
+ this.cur_att_manager = att_manager
|
|
|
+ this.call_back = call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ addWidgetByType(type:number){
|
|
|
+ // let node = instantiate(this.item_prefab)
|
|
|
+ let node = this.cur_att_manager.getMain().control_view.getWidgetByType(type)
|
|
|
+ // node.getComponent(widget_item).initWidgetByScene(data)
|
|
|
+ this.cur_att_manager.getMain().onPushEndWidget(node,Attributes.Singleton.get_cur_att_data().id)
|
|
|
+ }
|
|
|
+ start() {
|
|
|
+ this.btn_add_animation.on(Node.EventType.TOUCH_END,()=>{
|
|
|
+ this.addWidgetByType(config.Widget_Type_List.ACTION_TYPE)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.btn_add_image.on(Node.EventType.TOUCH_END,()=>{
|
|
|
+ this.addWidgetByType(config.Widget_Type_List.IMG_TYPE)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.btn_add_drop.on(Node.EventType.TOUCH_END,()=>{
|
|
|
+ this.addWidgetByType(config.Widget_Type_List.DRAG_TYPE)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.btn_add_click.on(Node.EventType.TOUCH_END,()=>{
|
|
|
+ this.addWidgetByType(config.Widget_Type_List.CLICK_TYPE)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.btn_add_slide.on(Node.EventType.TOUCH_END,()=>{
|
|
|
+ this.addWidgetByType(config.Widget_Type_List.SLIDE_TYPE)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ update(deltaTime: number) {
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|