Пример #1
0
    // GiveBuff - Gives a specific buff to the specified marble.
    protected virtual void GiveBuff(Marble marble)
    {
        // Adds icon to holding GUI box.
        Messenger <Sprite, Color> .Broadcast("SetHeldSprite", icon, iconTint);

        // Passes information about the buff to the marble.
        buffSlot = new BuffSlot(buffType, intensity, duration, particles, TakeBuff, BuffFunction);
        //marble.buffs[1] = buffSlot;
        marble.buffs.Add(buffSlot);
        AudioSource.PlayClipAtPoint(buffCollect, Vector3.zero, settings.FXScaler);
    }
Пример #2
0
    private void SetupSlot(BuffParametrs buff)
    {
        GameObject temp =
            Instantiate(blankBuffSlot,
                        buffArea.transform.position, Quaternion.identity);

        temp.transform.SetParent(buffArea.transform);
        temp.transform.localScale = new Vector3(1, 1, 1);
        BuffSlot newSlot = temp.GetComponent <BuffSlot>();

        if (newSlot)
        {
            newSlot.Setup(buff, this);
        }
    }