示例#1
0
 public void PollenCollected(PollenCollectable collectable)
 {
     this.RemainingPollenCount--;
     if (this.RemainingPollenCount == 0)
     {
         collectable.AddPollen(this.mAttributes.GetDouble(AttributeKeys.FlowerBonus));
         this.mSpinFlourish.Spin();
     }
 }
示例#2
0
    private void Start()
    {
        this.mAttributeSet = GameController.instance.Attributes;

        this.mPollenCollectable            = this.GetComponent <PollenCollectable>();
        this.mPollenCollectable.canCollect = true;
        this.mPollenCollectable.MaxPollen  = this.mAttributeSet.GetDouble(AttributeKeys.PollenCapacity);

        var pollenPoolObj = GameObject.FindGameObjectWithTag(GameObjectTags.ObjectPools.Pollen);

        this.mPollenPool = pollenPoolObj.GetComponent <ObjectPool>();
    }
示例#3
0
    /// <summary>
    /// Collects the pollen from <paramref name="other"/> and adds it to this collectable.
    /// </summary>
    /// <returns>true if collection occured (pollen count changed); otherwise false.</returns>
    public bool CollectFrom(PollenCollectable other)
    {
        if (!other.canCollect)
        {
            return(false);
        }
        if (other.CurrentPollen <= 0)
        {
            return(false);
        }

        if (this.AddPollen(other.CurrentPollen))
        {
            other.CurrentPollen = 0.0;
            return(true);
        }

        return(false);
    }