Ejemplo n.º 1
0
 private void Awake()
 {
     Instance              = this;
     winSourse             = gameObject.AddComponent <AudioSource>();
     winSourse.clip        = winClip;
     winSourse.playOnAwake = false;
     gameObject.SetActive(false);
 }
Ejemplo n.º 2
0
    void showWinPopUp()
    {
        GameObject parent = UICamera.first.transform.parent.gameObject;

        Debug.Log("PARENT NAME: " + parent.name);
        //Prefab
        GameObject obj   = NGUITools.AddChild(parent, winPopUpPrefab);
        WinPopUp   popup = obj.GetComponent <WinPopUp>();
    }
Ejemplo n.º 3
0
    void winWindow(HeroRabbit rabbit)
    {
        GameObject parent = UICamera.first.transform.parent.gameObject;
        //Створити Prefab
        GameObject obj = NGUITools.AddChild(parent, winPrefab);
        //Отримати доступ до компоненту (щоб передати параметри)
        WinPopUp popup = obj.GetComponent <WinPopUp>();        //???

        rabbit.winTune();
        //...
    }
Ejemplo n.º 4
0
    void showSettings()
    {
        //Знайти батьківський елемент
        GameObject parent = UICamera.first.transform.parent.gameObject;
        //Створити Prefab
        GameObject obj = NGUITools.AddChild(parent, winPrefab);
        //Отримати доступ до компоненту (щоб передати параметри)
        WinPopUp popup = obj.GetComponent <WinPopUp>();
        //...

        //popup.setFruitsCounts(3, 13);//
    }
Ejemplo n.º 5
0
    protected override void OnRabitHit(HeroRabit rabit)
    {
        GameObject parent   = UICamera.first.transform.parent.gameObject;
        GameObject obj      = NGUITools.AddChild(parent, winPopUpPrefab);
        WinPopUp   winPopUp = obj.GetComponent <WinPopUp>();

        LevelStatistic stats = LevelController.current.getStats();

        foreach (int f in stats.collectedFruits)
        {
            Debug.Log(f);
        }

        winPopUp.setStats(stats);

        Destroy(HeroRabit.lastRabit);

        stats.save();
    }
Ejemplo n.º 6
0
 private void Awake()
 {
     current = this;
     gameObject.SetActive(false);
 }