public void ChooseBranchEffect(int idx) { // for (int i = 0; i < view.branchView.Branches.Count; i++) { DialogBranchSingle brch = view.branchView.Branches [i]; if (idx == i) { brch.root.DOShakeRotation(2f).OnComplete(delegate() { view.branchView.root.gameObject.SetActive(false); nextAction(); }); } else if (brch.root.gameObject.activeSelf) { Tween tween = DOTween.To ( () => brch.Cg.alpha, (x) => brch.Cg.alpha = x, 0, 0.5f ); } } }
public void BindView(Transform root) { this.root = (RectTransform)root; BranchContainer = root.GetChild(0); foreach (Transform child in BranchContainer) { //Button btn = child.GetComponent<Button> (); DialogBranchSingle v = new DialogBranchSingle(); v.BindView(child); Branches.Add(v); } }