Exemplo n.º 1
0
    public override bool Combine(BlobBehaviour other)
    {
        if (other.GetType() == typeof(PullOthers))
        {
            PullOthers theOther = (PullOthers)other;

            float amountThis = magnitude / (magnitude + other.magnitude);

            magnitude += other.magnitude;
            pullSpeed  = pullSpeed * amountThis + theOther.pullSpeed * (1 - amountThis);

            return(true);
        }
        else
        {
            return(false);
        }
    }
Exemplo n.º 2
0
    public override bool Combine(BlobBehaviour other)
    {
        if (other.GetType() == typeof(TowardsTarget))
        {
            TowardsTarget theOther = (TowardsTarget)other;

            float amountThis = magnitude / (magnitude + other.magnitude);

            magnitude += other.magnitude;

            moveSpeed        = moveSpeed * amountThis + theOther.moveSpeed * (1 - amountThis);
            updateTargetSecs = updateTargetSecs * amountThis + theOther.updateTargetSecs * (1 - amountThis);

            return(true);
        }
        else
        {
            return(false);
        }
    }
Exemplo n.º 3
0
    public override bool Combine(BlobBehaviour other)
    {
        if (other.GetType() == typeof(Shoot))
        {
            Shoot theOther = (Shoot)other;

            float amountThis = magnitude / (magnitude + other.magnitude);

            magnitude += other.magnitude;

            shotSpeed     = shotSpeed * amountThis + theOther.shotSpeed * (1 - amountThis);
            shotSize      = shotSize * amountThis + theOther.shotSize * (1 - amountThis);
            shootTimeSecs = shootTimeSecs * amountThis + theOther.shootTimeSecs * (1 - amountThis);

            return(true);
        }
        else
        {
            return(false);
        }
    }