Esempio n. 1
0
    protected override void Awake()
    {
        base.Awake();

        m_BattleRoyaleManager = BattleRoyaleManager.Instance;

        m_BarImages   = new List <Image>();
        m_DeathImages = new List <Image>();
        m_Texts       = new List <Text>();

        for (int i = 0; i < m_PlayerSlots.Count; ++i)
        {
            Transform slotTr = m_PlayerSlots[i].transform;
            Transform uiTr   = slotTr.Find("UI");
            Transform barTr  = uiTr.Find("Bar");

            Image deathImage = uiTr.Find("DeathImage").GetComponent <Image>();
            Image barImage   = barTr.Find("FillBar").GetComponent <Image>();
            Text  text       = barTr.Find("Text").GetComponent <Text>();

            m_BarImages.Add(barImage);
            m_DeathImages.Add(deathImage);
            m_Texts.Add(text);
        }
    }
Esempio n. 2
0
    protected override void Awake()
    {
        base.Awake();

        m_BattleRoyaleManager = BattleRoyaleManager.Instance;
        m_StatsManager        = StatsManager.Instance;
    }
Esempio n. 3
0
    void Awake()
    {
#if UNITY_EDITOR
        if (m_SaveCleared == false)
        {
            //PlayerPrefs.DeleteAll();
            m_SaveCleared = true;
        }
        PlayerPrefs.SetInt(Constants.c_LevelSave, m_DebugLevel);
#endif

        Application.targetFrameRate = 60;

        // Cache
        m_StatsManager        = StatsManager.Instance;
        m_ProgressionView     = ProgressionView.Instance;
        m_MainMenuView        = MainMenuView.Instance;
        m_BattleRoyaleManager = BattleRoyaleManager.Instance;
        m_SpotlightOffset     = m_HumanSpotlight.position;
        m_DailyRewardManager  = DailyRewardManager.Instance as DailyRewardManager;

        // Buffers
        m_Objects   = new List <GameObject>();
        m_PosBuffer = Vector3.zero;
        m_Brushs    = new List <BrushData>(Resources.LoadAll <BrushData>("Brushs/GameBrushs"));
        //m_Skins = new List<SkinData>(Resources.LoadAll<SkinData>("Skins"));
        m_MenuBrushs = new List <BrushData>(Resources.LoadAll <BrushData>("Brushs/MenuBrushs"));
        m_Skins      = new List <SkinData>(Resources.LoadAll <SkinData>("Skins/SkinShop"));

        List <ColorData> colorsData = new List <ColorData>(Resources.LoadAll <ColorData>("Colors"));
        m_Colors = new List <Color>();
        for (int i = 0; i < colorsData.Count; ++i)
        {
            ColorData colorData = colorsData[i];
            m_Colors.Add(colorData.m_Colors[0]);
        }

        m_PlayerNameData = Resources.Load <PlayerNameData>("PlayerNames");
        m_TerrainManager = TerrainManager.Instance;

        float halfWidth  = m_TerrainManager.WorldHalfWidth;
        float halfHeight = m_TerrainManager.WorldHalfHeight;

        m_PopPoints = new List <Vector3>()
        {
            new Vector3(-halfWidth + c_PopPointPadding + c_PopPointTeamPadding, 0.0f, -halfHeight + c_PopPointPadding - c_PopPointTeamPadding),
            new Vector3(-halfWidth + c_PopPointPadding - c_PopPointTeamPadding, 0.0f, -halfHeight + c_PopPointPadding + c_PopPointTeamPadding),
            new Vector3(halfWidth - c_PopPointPadding - c_PopPointTeamPadding, 0.0f, -halfHeight + c_PopPointPadding - c_PopPointTeamPadding),
            new Vector3(halfWidth - c_PopPointPadding + c_PopPointTeamPadding, 0.0f, -halfHeight + c_PopPointPadding + c_PopPointTeamPadding),
            new Vector3(-halfWidth + c_PopPointPadding + c_PopPointTeamPadding, 0.0f, halfHeight - c_PopPointPadding + c_PopPointTeamPadding),
            new Vector3(-halfWidth + c_PopPointPadding - c_PopPointTeamPadding, 0.0f, halfHeight - c_PopPointPadding - c_PopPointTeamPadding),
            new Vector3(halfWidth - c_PopPointPadding + c_PopPointTeamPadding, 0.0f, halfHeight - c_PopPointPadding - c_PopPointTeamPadding),
            new Vector3(halfWidth - c_PopPointPadding - c_PopPointTeamPadding, 0.0f, halfHeight - c_PopPointPadding + c_PopPointTeamPadding),
        };

        m_PowerUps = new List <PowerUpData>(Resources.LoadAll <PowerUpData>("PowerUps"));
    }
Esempio n. 4
0
    private void Awake()
    {
        m_GameManager = GameManager.Instance;
        m_GameManager.onScoresCalculated    += OnScoresCalculated;
        m_GameManager.onEndGame             += OnEndGame;
        m_BattleRoyaleManager                = BattleRoyaleManager.Instance;
        m_BattleRoyaleManager.onElimination += OnElimination;

        m_RectTransform = GetComponent <RectTransform>();

        m_CurrentPercentBars = new List <PlayerPercentBar>(m_PercentBars);
    }
Esempio n. 5
0
    protected override void Awake()
    {
        base.Awake();

        // Cache
        m_BattleRoyaleManager = BattleRoyaleManager.Instance;
        m_CountDownStart.transform.localScale = Vector2.zero;
        m_TimeAndPercentCanvasGroup           = m_TimeAndPercentObject.GetComponent <CanvasGroup>();
        m_ScreenShaker = ScreenShaker.Instance;

        HideGroup();
    }
Esempio n. 6
0
 protected override void Awake()
 {
     base.Awake();
     m_BattleRoyale = BattleRoyaleManager.Instance;
     m_GameManager.onGamePhaseChanged += OnGamePhaseChanged;
 }