コード例 #1
0
    // Use this for initialization
    void Start()
    {
        _sessionManager = GameObject.FindGameObjectWithTag("tSession").GetComponent <LFSessionManager>();

        if (labyrinth != null)
        {
            _labyrinth = labyrinth.GetComponent <LFLabyrinthGeneration>();
            _labyrinth.StartInitLabyrinth();
            _grid = labyrinth.GetComponent <LFGrid>();
            _grid.StartInitGrid();
            _enemyGenerator  = labyrinth.GetComponent <LFEnemyGenerator>();
            _coinGenerator   = labyrinth.GetComponent <LFCoinGenerator>();
            _animalGenerator = labyrinth.GetComponent <LFAnimalGenerator>();
            CreatePlayer();
        }

        _time    = 0.0f;
        _dayTime = changeDateStateTime;

        LFEventManager.coin     += PlayerDidGetCoin;
        LFEventManager.gameOver += PlayerDidDie;

        if (_enemyGenerator != null)
        {
            //_enemyGenerator.CreateZombie();

            for (int i = 0; i < 10; i++)
            {
                _enemyGenerator.CreateZombie();
            }
        }

        if (_animalGenerator != null)
        {
            //_enemyGenerator.CreateZombie();

            for (int i = 0; i < 10; i++)
            {
                _animalGenerator.CreatePing();
            }
        }

        if (_player != null && camera != null)
        {
            camera.GetComponent <LFCameraFollow>().target            = _player.transform;
            camera.GetComponent <LFCameraFollow> ().leftBottomCorner = GetBottomLeftCameraPos();
            camera.GetComponent <LFCameraFollow> ().topRightCorner   = GetTopRightCameraPos();
        }

        if (_player != null && playeInfo != null)
        {
            playeInfo.player = _player;
        }

        UpdateDayState();
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     _labyrinth  = gameObject.GetComponent <LFLabyrinthGeneration>();
     _pathFinder = gameObject.GetComponent <LFPathFinder>();
     _enemyList  = new List <GameObject>();
 }
コード例 #3
0
 void Awake()
 {
     _grid      = gameObject.GetComponent <LFGrid> ();
     _labyrinth = gameObject.GetComponent <LFLabyrinthGeneration> ();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     _coins       = new List <GameObject> ();
     _deleteCoins = new List <GameObject> ();
     _labyrinth   = gameObject.GetComponent <LFLabyrinthGeneration>();
 }