blob: d0d80dcbe681f100ebc9f6f090904ba25d8f20a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
using System;
using UnityEngine;
public class GameSettingMenu : MonoBehaviour
{
public Transform[] AllItems;
public float YStart;
public float YOffset;
public Transform[] HideForOnline;
private void OnEnable()
{
int num = 0;
for (int i = 0; i < this.AllItems.Length; i++)
{
Transform transform = this.AllItems[i];
if (transform.gameObject.activeSelf)
{
if ((AmongUsClient.Instance.GameMode == GameModes.OnlineGame && this.HideForOnline.IndexOf(transform) != -1) || transform.name == "MapName")
{
transform.gameObject.SetActive(false);
}
else
{
Vector3 localPosition = transform.localPosition;
localPosition.y = this.YStart - (float)num * this.YOffset;
transform.localPosition = localPosition;
num++;
}
}
}
base.GetComponent<Scroller>().YBounds.max = (float)num * this.YOffset / 2f + 0.1f;
}
}
|