Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        // Init Config
        configGO = GameObject.Find("Config").gameObject;
        config   = configGO.GetComponent <DoConfig>();

        // Retrieve screens
        if (activeScreens == null)
        {
            activeScreens       = GameObject.FindGameObjectsWithTag("active_screen");
            currentActiveScreen = activeScreens[1];
            randomActiveScript  = currentActiveScreen.GetComponent <RandomActive>();
        }
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
        unitList    = new List <GameObject>();

        if (isTestMap)
        {
            return;
        }

        gem      = transform.parent.Find("07_Gem").GetComponent <RandomActive>();
        isClosed = true;
        trees    = GameObject.FindGameObjectWithTag("MapCreater").GetComponent <CreatMapMatrix>().trees;
    }
Ejemplo n.º 3
0
    // Coroutine to active random screen
    IEnumerator ActiveScreenRandomly()
    {
        inCoRoutine = true;

        // Take a random screen
        randomActiveScreenIdx = 0; // Random.Range (0, activeScreens.Length - 1);
        currentActiveScreen   = activeScreens[randomActiveScreenIdx];
        randomActiveScript    = currentActiveScreen.GetComponent <RandomActive>();

        // Call screen coroutine enable/disabled
        int randomTime = Random.Range(config.activeScreenRangeMin, config.activeScreenRangeMax);

        yield return(StartCoroutine(randomActiveScript.screenAction(randomTime)));

        inCoRoutine = false;
    }
Ejemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     background = transform.parent.parent.Find("00_Background").GetComponent <RoomInfo>();
     spawnPos   = transform.parent.parent.Find("SpawnPostion").gameObject;
     gemcount   = transform.parent.GetComponent <RandomActive>();
 }