Transform Set Sibling Index#
Transform / Hierarchy / Transform Set Sibling Index
Description#
Changes the position of the Transform in its hierarchy
Parameters#
| Name | Description |
|---|---|
| Index |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Transform Set Sibling Index")]
[Category("Transform/Hierarchy/Set Sibling Index")]
[Description("Changes the position of the Transform in its hierarchy")]
[Image(typeof(IconCubeOutline), ColorTheme.Type.Lime, typeof(BadgeIndex))]
[Keywords("Transform")]
[Parameter("Index")]
[Serializable]
public class GenInstructionTransform_SetSiblingIndex_1 : Instruction
{
[SerializeField] private GetGameObject m_Transform = new GetGameObject(
new GenTypeGameObject_Transform()
);
[SerializeField] private GetInteger m_Index = new GetInteger();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Set Sibling Index");
return $"{this.m_Transform} {method} ({this.m_Index})";
}
protected override Awaitable Run(Args args)
{
Transform component = this.m_Transform.Get<Transform>(args);
if (component == null) return Done;
component.SetSiblingIndex(
(int) this.m_Index.Get(args)
);
return Done;
}
}
}