Exemple #1
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"));
    }