Exemplo n.º 1
0
    void Start()
    {
        currentsceneName = SceneManager.GetActiveScene().name;

        rigidBody   = GetComponent <Rigidbody>();
        audioSource = GetComponent <AudioSource>();

        gameSession        = FindObjectOfType <GameSession>();
        sceneLoader        = FindObjectOfType <SceneLoader>();
        deathHandler       = FindObjectOfType <DeathHandler>();
        timer              = FindObjectOfType <Timer>();
        levelButtonManager = FindObjectOfType <LevelButtonManager>();

        FindObjectOfType <GameSession>().AddToNumberOfGamesPlayed(GameNumber);
    }
 //设置关卡的图样和按键激活情况
 public void SetLevelPicture(int city)
 {
     for (int i = 0; i < m_LevelButton.Length; ++i)
     {
         LevelContent       Temp           = GetLevelByCityAndLevel(city, i + 1);
         LevelButtonManager ButtonIManager = m_LevelButton[i].GetComponent <LevelButtonManager>();
         if (!Temp.Open)
         {
             m_LevelButton[i].enabled = false;
         }
         else
         {
             m_LevelButton[i].enabled = true;
         }
         ButtonIManager.SetCoverAndStar(Temp.Open, Temp.StarNum);
     }
 }
Exemplo n.º 3
0
    public void SetUp(LevelButtonManager levelBeuttonM, RectTransform con, int pos)
    {
        levelButtonManager = levelBeuttonM;
        levelRef           = pos;
        transform.SetParent(con);

        float buttonWidth  = 60.0f;
        float buttonHeight = 60.0f;
        float padding      = 10.0f;

        RectTransform rect = GetComponent <RectTransform>();
        float         x1, x2, y1, y2;

        x1 = pos * (buttonWidth + padding) + padding;
        x2 = x1 + buttonWidth;
        y1 = -(padding + buttonHeight);
        y2 = y1 + buttonHeight;

        rect.offsetMin = new Vector2(x1, y1);
        rect.offsetMax = new Vector2(x2, y2);
    }
Exemplo n.º 4
0
 public void SetUp(MainManager mainM)
 {
     Debug.Log(TAG + "setting up.");
     mainManager        = mainM;
     levelButtonManager = GetComponent <LevelButtonManager>();
 }