first commit
This commit is contained in:
37
Gameplay/Phone.cs
Normal file
37
Gameplay/Phone.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public partial class Phone : Sprite2D
|
||||
{
|
||||
public PhoneButton _hoveredButton;
|
||||
public List<PhoneButton> _phoneButtons = new();
|
||||
public Player _player;
|
||||
public override void _Ready()
|
||||
{
|
||||
_phoneButtons = GetChildren().Where(c=>c is PhoneButton).Cast<PhoneButton>().ToList();
|
||||
for (int i = 0; i < _phoneButtons.Count; i++)
|
||||
{
|
||||
_phoneButtons[i]._phone = this;
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(double DELTA_)
|
||||
{
|
||||
// _hoveredButton = _phoneButtons.FirstOrDefault(c => c._isHovered, null);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void PassPlayer(Player PLAYER)
|
||||
{
|
||||
_player = PLAYER;
|
||||
for (int i = 0; i < _phoneButtons.Count; i++)
|
||||
{
|
||||
_phoneButtons[i]._phone = this;
|
||||
_phoneButtons[i]._contact.PassPlayer(PLAYER);
|
||||
_phoneButtons[i]._contact.PassNumber((i+1)%10);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user