本文整理汇总了C#中Transform.SetActive方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.SetActive方法的具体用法?C# Transform.SetActive怎么用?C# Transform.SetActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.SetActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupOther
private void SetupOther()
{
water = GameObject.Find("water").transform;
water.SetActive(QualitySettings.currentLevel != QualityLevel.Fastest);
if (debug) prestartTm = 0;
_MenuGui.Hide();
}
示例2: OnSceneGUI
public override void OnSceneGUI(SceneView scene, ref bool repaint)
{
if (e.type == EventType.keyDown)
repaint = true;
if (e.keyCode == KeyCode.Alpha1)
tool = Tool.None;
if (e.keyCode == KeyCode.Alpha2)
tool = Tool.Grid;
if (e.keyCode == KeyCode.Alpha3)
tool = Tool.Trail;
if (tool != Tool.None && !e.alt)
{
for (int i = 0; i < prefabst.Length; i++)
if (prefabsi != i) prefabs[i].SetActive(false);
SelectedPrefab = prefabs[prefabsi];
if (e.type == EventType.scrollWheel)
{
var i = (int)(Mathf.Clamp(e.delta.y, -1, 1));
if (e.modifiers == EventModifiers.Control)
gridSize -= i;
else if (e.modifiers == EventModifiers.Shift)
prefabsi = Mathf.Clamp(prefabsi + i, 0, prefabs.Length - 1);
else
PlanePos += i;
repaint = true;
e.Use();
}
if (e.shift && e.delta.magnitude > 1 && axelLock == 0)
{
if (Mathf.Abs(e.delta.x) > Mathf.Abs(e.delta.y))
axelLock = 1;
else
axelLock = 2;
}
if (!e.shift)
axelLock = 0;
if (e.isMouse)
{
if (e.type == EventType.mouseDown && tool != Tool.None)
Undo.RegisterSceneUndo("rtools");
if (e.button != 2)
visible = true;
else
visible = false;
}
SelectedPrefab.transform.localScale = Vector3.one * .999f * gridSize;
UpdateCursor();
if (tool == Tool.Grid)
{
UpdateGrid(scene);
}
if (tool == Tool.Trail)
{
UpdateTrail(e);
}
UpdateRemove(e);
SelectedPrefab.SetActive(visible);
}
//else
//{
// if (SelectedPrefab.gameObject.active)
// SelectedPrefab.SetActive(false);
//}
}