Beispiel #1
0
    void Awake()
    {
        m_turnControl = new TurnControl ();
        List<int> turns = new List<int>(2);
        turns.Add (TurnControl.TURN_PLAYER);
        turns.Add (TurnControl.TURN_ENEMY_1);
        m_turnControl.initTurns (turns);

        m_playerLifeControl = GameObject.Find ("LifeText").GetComponent<LifeControl>();

        GameObject[] enemyObjs = GameObject.FindGameObjectsWithTag("Enemy");
        enemys = new ArrayList();
        foreach (GameObject t in enemyObjs) {
            enemys.Add(t.GetComponent<EnemyControl>());
        }
        //
        slideControl = gameObject.GetComponent<SlideResultControl>();

        slideControl.slideDelegates += slideTo;

        candys = new Dictionary<int, GameObject> ();

        //create candys
        for (int i = 0; i < mapRow; i++) {
            for(int j = 0 ; j < mapLine ;j++)
            {
                GameObject t = createCandyBy(i,j,randomCandyType());

                candys.Add(i*ROW_SCALE_FOR_KEY + j,t);
            }
        }
    }