Beispiel #1
0
    private void Initialize()
    {
        moveForward = FindObjectOfType <MoveForward>();
        if (moveForward != null)
        {
            moveForward.Initialize(mainConfig.Speed);
        }

        tilePool = GetComponent <RoadTilePool>();
        if (tilePool != null)
        {
            tilePool.Initialize(mainConfig.Speed);
        }

        roadGenerator = GetComponent <RoadGenerator>();
        if (roadGenerator != null)
        {
            roadGenerator.Initialize(mainConfig.Speed);
        }

        playerMover = FindObjectOfType <PlayerMover>();
        if (playerMover != null)
        {
            playerMover.Initialize(mainConfig.Speed);
        }

        treasure = FindObjectOfType <Treasure>();
        if (treasure != null)
        {
            treasure.Initialize();
        }

        towerController = FindObjectOfType <PlayerTowerController>();
        if (towerController != null)
        {
            towerController.Initialize();
        }
    }
 private void Awake()
 {
     towerController = FindObjectOfType <PlayerTowerController>();
     points          = GetPoints();
 }