Esempio n. 1
0
    async public Task AppearSeal(int index)
    {
        var currentSeal = SealSlotDisplays.GetChild <SealSlot>(index);

        currentSeal.ShowSlot(BattleScene.SealSlots[index]);
        currentSeal.Change(BattleScene.SealSlots[index]);
        await ToSignal(currentSeal.MyTween, "tween_completed");
    }
Esempio n. 2
0
    async public Task DisappearSeal(int index)
    {
        var currentSeal = SealSlotDisplays.GetChild <SealSlot>(index);

        currentSeal.Change(Element.None);
        await ToSignal(currentSeal.MyTween, "tween_completed");

        currentSeal.ShowSlot(Element.None);
        currentSeal.Modulate = new Color(1, 1, 1, 1);
    }
Esempio n. 3
0
    public void DisplaySeals()
    {
        int i = 0;

        foreach (var slot in BattleScene.SealSlots)
        {
            SealSlotDisplays.GetChild <SealSlot>(i).ShowSlot(slot);
            RayCircle.SetSlot(slot, i);
            i++;
        }
    }
Esempio n. 4
0
    // async public Task ReplaceSeal (int index) {
    //     // await DisappearSeal(index);
    //     await AppearSeal(index);
    // }
    async public Task MoveSeal(int index, int indexTo, Element element)    //By default, willmove the element that is at index
    {
        var fromSeal = SealSlotDisplays.GetChild <SealSlot>(index);
        var toSeal   = SealSlotDisplays.GetChild <SealSlot>(indexTo);

        fromSeal.ShowSlot(element);
        fromSeal.MoveTo(toSeal.RectPosition - fromSeal.RectPosition);
        await ToSignal(fromSeal.MyTween, "tween_completed");

        toSeal.ShowSlot(element);
        // fromSeal.ShowSlot(Element.None);
    }
Esempio n. 5
0
 ////////////////////////////////
 ////////// Display
 /////////////
 ///////
 public void InitializeSlots(int slotCount)
 {
     SlotCount = slotCount;
     RayCircle.SetSlotCount(slotCount);
     CenterPosition = GetNode <Position2D>("Center").Position;
     CenterToSlot   = GetNode <Position2D>("FirstSealSlot").Position - GetNode <Position2D>("Center").Position;
     for (int i = 0; i < SlotCount; i++)
     {
         var slot = GD.Load <PackedScene>(sealSlotPath).Instance().GetNode <SealSlot>("./");
         slot.Circle       = this;
         slot.RectPosition = CenterPosition + CenterToSlot;
         slot.id           = i;
         // slot.Name = i.ToString();
         SealSlotDisplays.AddChild(slot);
         slot.ShowSlot(Element.None);
         CenterToSlot = CenterToSlot.Rotated(2 * Mathf.Pi / SlotCount);
     }
 }
Esempio n. 6
0
 public SealSlot GetSeal(int i)
 {
     return(SealSlotDisplays.GetChild <SealSlot>(i));
 }