Пример #1
0
    // Use this for initialization
    void Start()
    {
        levelTableObject =  Instantiate(Resources.Load<GameObject>(levelTablePath));
        levelTableObject.transform.SetParent(transform);
        _levelTables = levelTableObject.GetComponent<LevelTables>();

        mainCameraObject =  Instantiate(Resources.Load<GameObject>(mainCameraPath));
        mainCameraObject.transform.SetParent(transform);
        _mainCamera = mainCameraObject.GetComponent<Camera>();

        probeObject = Instantiate(Resources.Load<GameObject>(probePath));
        probeObject.transform.SetParent(transform);

        lightObject = Instantiate(Resources.Load<GameObject>(lightPath));
        lightObject.transform.SetParent(transform);
        //_directionalLight = lightObject.GetComponent<Light>();

        eventSystemObject =  Instantiate(Resources.Load<GameObject>(eventSystemPath));
        eventSystemObject.transform.SetParent(transform);

        gameUIObject =  Instantiate(Resources.Load<GameObject>(gameUIPath));
        gameUIObject.transform.SetParent(transform);
        _gameUI = gameUIObject.GetComponent<GameUI>();

        gameControllerObject = Instantiate(Resources.Load<GameObject>(gameControllerPath));
        _gameController = gameControllerObject.GetComponent<GameController>();
        gameControllerObject.transform.SetParent(transform);

        audioSources = GetComponents<AudioSource>();
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        appController = transform.root.gameObject.GetComponent<AppliController>();
        GameScene gameScene = appController.GetCurrentScene().GetComponent<GameScene>();
        gameController = gameScene.gameController;
        nextLevel = -1;

        audioSource = GetComponent<AudioSource>();

        levelState = _eLevelState.STAND;

        levelTableScript = gameScene.levelTables;

        levelChangePrefab = Resources.Load<GameObject>(levelChangePath);
        animationPrefab = Resources.Load<GameObject>(animationPath);

        gOption = gameScene.gameUI.gamePause;
         //       gameScene.gameUI.gameInfoCanvas.GetComponentInChildren<fieldImage>().gameObject.GetComponent<Button>().onClick.AddListener(TouchChange);
    }