private void OnNewInteractiveGOCreated(DisplayableEntityModel model) { InteractiveGameObjectModel targetModel = model as InteractiveGameObjectModel; HierarchyGOController hierarchyGO = GameResourceManager.Instance.CreateEntityController <HierarchyGOModel>("hierarchy_go") as HierarchyGOController; HierarchyGOModel hierarchyModel = hierarchyGO.model; hierarchyCtlList.Add(hierarchyGO); targetModel.hierarchyGO = hierarchyGO.model; hierarchyModel.attachedGO = model; hierarchyModel.goName = targetModel.name; Transform parent = (targetModel.parent as InteractiveGameObjectModel)?.hierarchyGO?.view.transform.Find("Children") ?? hierarchyGOGroup; hierarchyModel.view.transform.SetParent(parent, false); }
public override void BindEntityModel(EntityModel model) { base.BindEntityModel(model); this.model = model as HierarchyGOModel; this.model.view.hierarchyButton.onClick.AddListener(OnClickHierarchyGO); }
public override void BindEntityModel(DisplayableEntityModel model) { base.BindEntityModel(model); this.model = model as HierarchyGOModel; this.model.OnGONameChanged += SetGoName; }