当前位置: 首页>>代码示例>>C#>>正文


C# Transform.GetSiblingIndex方法代码示例

本文整理汇总了C#中UnityEngine.Transform.GetSiblingIndex方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.GetSiblingIndex方法的具体用法?C# Transform.GetSiblingIndex怎么用?C# Transform.GetSiblingIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Transform的用法示例。


在下文中一共展示了Transform.GetSiblingIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TransformWithSlibind

		public TransformWithSlibind(Transform t)
		{
			this.t = t;
			slibind = new List<int>();
			slibind.Add(t.GetSiblingIndex());
			while (t.parent != null)
			{
				slibind.Insert(0, t.parent.GetSiblingIndex());
				t = t.parent;
			}
		}
开发者ID:fengqk,项目名称:Art,代码行数:11,代码来源:CopyAttributeEditor.cs

示例2: OnPointerDown

 public void OnPointerDown(int bottle)
 {
     if (!nextBtn.isActiveAndEnabled)
     {
         PlaySoundClick();
         startBottleParent = bottleList[bottle].transform.parent;
         startBottleParent.GetComponent<GridLayoutGroup>().enabled = false;
         onFrontScene.transform.position = bottleList[bottle].transform.parent.position;
         bottleList[bottle].transform.SetParent(onFrontScene.transform, false);
         silbingPanelIndex = startBottleParent.GetSiblingIndex();
     }
 }
开发者ID:NashIlli,项目名称:calculandox,代码行数:12,代码来源:BottleDistributionView.cs

示例3: Rebase

		static public void Rebase(Transform transform, Transform to)
		{
			var transformSO = new SerializedObject(transform);
			var toSO = new SerializedObject(to);

			var transformPrefabLink = transformSO.FindProperty("m_PrefabInternal").objectReferenceValue;
			var toPrefabLink = toSO.FindProperty("m_PrefabInternal").objectReferenceValue;

			toSO.FindProperty("m_PrefabInternal").objectReferenceValue = null;
			transformSO.FindProperty("m_PrefabInternal").objectReferenceValue = null;

			transformSO.ApplyModifiedProperties();
			toSO.ApplyModifiedProperties();

			var index = transform.GetSiblingIndex();
			var lp = transform.localPosition;
			var lr = transform.localRotation;
			var ls = transform.localScale;
			transform.parent = to;
			transform.localPosition = lp;
			transform.localRotation = lr;
			transform.localScale = ls;
			transform.SetSiblingIndex(index);

			transformSO.Update();
			toSO.Update();

			transformSO.FindProperty("m_PrefabInternal").objectReferenceValue = transformPrefabLink;
			toSO.FindProperty("m_PrefabInternal").objectReferenceValue = toPrefabLink;

			transformSO.ApplyModifiedProperties();
			toSO.ApplyModifiedProperties();
		}
开发者ID:Zammy,项目名称:ProjectSpaceship,代码行数:33,代码来源:PEPropertyHelper.cs

示例4: Update


//.........这里部分代码省略.........
                    Vector3 currentOffset;
                    float currentY = selectedArtistContainer.position.y;
                    if (!waitingForAlbumSelection) {
                        foreach (Transform album in selectedArtistContainer) {
                            currentOffset = new Vector3(folderEndPositions[0].x * -0.2f, 0, folderEndPositions[0].z * -0.2f);
                            albumEndPositions[albumIndex] = (new Vector3(folderEndPositions[0].x * 0.8f, currentY, folderEndPositions[0].z * 0.8f) - currentOffset*(currentY/-0.5f));
                            positionAlbum(album.gameObject, albumEndPositions[albumIndex]);
                            albumIndex++;
                            currentY -= 0.1f;
                        }
                    }
                }
                if (Input.GetKeyDown("x")) {
                    folderIsMoving = true;
                    artistSelected = false;
                    waitingForAlbumSelection = false;
                    //Move albums back, deactivate
                    foreach (Transform album in selectedArtistContainer) {
                        album.gameObject.SetActive(false);
                    }
                    albumsOut = false;
                    foldersLifted = false;
                }

                if (Input.GetKeyDown("w")) {
                    waitingForAlbumSelection = true;
                    if (selectedAlbumIndex > 0) {
                        selectedAlbum.GetChild(0).gameObject.SetActive(false);
                        selectedAlbumIndex--;

                        //Move albums down
                        albumLiftingDown = true;
                        previouslySelectedAlbum = selectedAlbum;
                        previouslySelectedAlbumIndex = previouslySelectedAlbum.GetSiblingIndex();
                        scrollTarget = selectedAlbum.parent.GetChild(previouslySelectedAlbumIndex-1).localPosition + new Vector3(0, -3, 0);
                    }
                }
                if (Input.GetKeyDown("s")) {
                    waitingForAlbumSelection = true;
                    if (selectedAlbumIndex < selectedArtistContainer.childCount-1) {
                        selectedAlbum.GetChild(0).gameObject.SetActive(false);
                        selectedAlbumIndex++;

                        //Move albums up
                        albumLiftingUp = true;
                        previouslySelectedAlbum = selectedAlbum;
                        previouslySelectedAlbumIndex = previouslySelectedAlbum.GetSiblingIndex();
                        scrollTarget = selectedAlbum.parent.GetChild(previouslySelectedAlbumIndex+1).localPosition + new Vector3(0, 3, 0);
                    }
                }
                if (Input.GetKeyDown("f") && albumsOut && !albumSelected) {
                    albumSelected = true;
                }
                selectedAlbum = selectedArtistContainer.transform.GetChild(selectedAlbumIndex);
                if (albumLiftingUp) {
                    liftAlbumUp(previouslySelectedAlbum.gameObject, scrollTarget);
                }
                if (albumLiftingDown) {
                    liftAlbumDown(selectedAlbum.gameObject, albumEndPositions[selectedAlbumIndex]);
                }

            }
        } catch (UnityException) {

        }
开发者ID:robideau,项目名称:MusicShelf,代码行数:66,代码来源:ShelfInteraction.cs

示例5: CreateLayoutElement

		public void CreateLayoutElement(Transform element) {
			
			EditorApplication.delayCall += () => {
				
				EditorApplication.delayCall = null;

				FlowDatabase.AddLayoutElementComponent("LayoutElement", element.parent, element.GetSiblingIndex());

			};

		}
开发者ID:puckery,项目名称:Unity3d.UI.Windows,代码行数:11,代码来源:FlowHierarchyWindow.cs


注:本文中的UnityEngine.Transform.GetSiblingIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。