Hi, I am trying to make a loading screen, where at the start of the scene, all of the objects are inactive, and then one by one, they activate.
Here is my current code.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class LoadingScreen : MonoBehaviour
{
public float Percentage;
public GameObject MainObj;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
Transform[] Trans = (Transform[])MainObj.transform.GetComponentsInChildren(typeof(Transform),true);
//GameObject[] ActiveObjs;
//Array Arr = new Array();
List<GameObject> Active = new List<GameObject>();
for(int i = 0; i<Trans.Length;i++){
Trans*.gameObject.active = true;*
_ Active.Add(Trans*.gameObject);_
_ }*_
_ Percentage = (Trans.Length/Active.Capacity)100;_
_ }_
_}*_
BTW the error is the title.
I am really stuck, please help.
Thanks
Tz