//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public int GetChildOrder(IArcLayoutable pFirst, IArcLayoutable pSecond) { int firstIndex = -1; int secondIndex = -1; int i = 0; foreach ( Transform childTx in gameObject.transform ) { IArcLayoutable elem = childTx.GetComponent<IArcLayoutable>(); if ( elem == pFirst ) { firstIndex = i; } if ( elem == pSecond ) { secondIndex = i; } if ( firstIndex != -1 && secondIndex != -1 ) { return firstIndex.CompareTo(secondIndex); } i++; } return 0; }
/*--------------------------------------------------------------------------------------------*/ public void DisableAllChildrenExcept( IArcLayoutable pIgnoreChildA=null, IArcLayoutable pIgnoreChildB=null) { for ( int i = 0 ; i < vChildItems.Count ; i++ ) { HoverLayoutArcGroupChild item = vChildItems[i]; if ( item.Elem == pIgnoreChildA || item.Elem == pIgnoreChildB ) { continue; } item.Elem.transform.gameObject.SetActive(false); } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverLayoutArcGroupChild(IArcLayoutable pElem, HoverLayoutArcRelativeSizer pSizer) { Elem = pElem; RelSizer = pSizer; }