Example #1
0
    private bool Shoot()
    {
        if (f_availableFeathers.Count == 0)
        {
            //TODO; this isn't nice since the animation still got played
            return(false);
        }

        Feather chosenFeather = null;

        for (int i = 0; i < f_allFeathers.Count; ++i)
        {
            if (chosenFeather != null)
            {
                break;
            }
            if (f_availableFeathers.Contains(f_allFeathers[m_nextFeather]))
            {
                chosenFeather = f_allFeathers[m_nextFeather];
            }

            m_nextFeather = (m_nextFeather + 1) % f_allFeathers.Count;
        }

        f_availableFeathers.Remove(chosenFeather);

        // the point will be ignored in the Featehr script anyway
        chosenFeather.Shoot(Consts.Instance.Player.transform.position);

        return(true);
    }