示例#1
0
 private void Generate()
 {
     if (!NetworkServer.active)
     {
         Debug.LogWarning("[Server] function 'System.Void RoR2.SceneObjectToggleGroup::Generate()' called on client");
         return;
     }
     for (int i = 0; i < this.internalToggleGroups.Length; i++)
     {
         SceneObjectToggleGroup.ToggleGroupRange toggleGroupRange = this.internalToggleGroups[i];
         int        num  = Run.instance.stageRng.RangeInt(toggleGroupRange.minEnabled, toggleGroupRange.maxEnabled + 1);
         List <int> list = SceneObjectToggleGroup.< Generate > g__RangeList | 12_0 (toggleGroupRange.start, toggleGroupRange.count);
         Util.ShuffleList <int>(list, Run.instance.stageRng);
         for (int j = num - 1; j >= 0; j--)
         {
             this.activations[list[j]] = true;
             list.RemoveAt(j);
         }
         for (int k = 0; k < list.Count; k++)
         {
             this.activations[list[k]] = false;
         }
     }
     base.SetDirtyBit(1U);
 }
示例#2
0
        // Token: 0x060012C6 RID: 4806 RVA: 0x00050908 File Offset: 0x0004EB08
        private void Awake()
        {
            SceneObjectToggleGroup.activationsQueue.Enqueue(this);
            int num = 0;

            for (int i = 0; i < this.toggleGroups.Length; i++)
            {
                num += this.toggleGroups[i].objects.Length;
            }
            this.allToggleableObjects = new GameObject[num];
            this.activations          = new bool[num];
            this.internalToggleGroups = new SceneObjectToggleGroup.ToggleGroupRange[this.toggleGroups.Length];
            int start = 0;

            for (int j = 0; j < this.toggleGroups.Length; j++)
            {
                GameObject[] objects = this.toggleGroups[j].objects;
                SceneObjectToggleGroup.ToggleGroupRange toggleGroupRange = default(SceneObjectToggleGroup.ToggleGroupRange);
                toggleGroupRange.start       = start;
                toggleGroupRange.count       = objects.Length;
                toggleGroupRange.minEnabled  = this.toggleGroups[j].minEnabled;
                toggleGroupRange.maxEnabled  = this.toggleGroups[j].maxEnabled;
                this.internalToggleGroups[j] = toggleGroupRange;
                foreach (GameObject gameObject in objects)
                {
                    this.allToggleableObjects[start++] = gameObject;
                }
            }
            if (NetworkServer.active)
            {
                this.Generate();
            }
        }