Exemplo n.º 1
0
    private void Awake()
    {
        m_sprite         = GetComponent <SpriteRenderer>().sprite;
        m_averageColor   = ColorTools.CalculateAverageColor(m_sprite);
        m_particleSystem = GetComponent <ParticleSystem>();
        var particleSystemMain = m_particleSystem.main;

        particleSystemMain.startColor = m_averageColor;

        var player = GameObject.Find("Player");

        if (player)
        {
            m_playerBaseScript = GetComponent <PlayerBase>();
        }
        else
        {
            Debug.LogError("Player needed to init pickup");
        }
    }