55 lines
1.2 KiB
C#
55 lines
1.2 KiB
C#
using Godot;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
public partial class Contact : Sprite2D
|
|
{
|
|
public int _number;
|
|
public List<Effect> _effects;
|
|
public PhoneButton _button;
|
|
// public
|
|
|
|
public override void _Ready()
|
|
{
|
|
|
|
}
|
|
|
|
public virtual void FireEffect()
|
|
{
|
|
|
|
}
|
|
|
|
public virtual void End()
|
|
{
|
|
_effects.ForEach(e=>e.End());
|
|
}
|
|
|
|
public void LoadEffect(string EFFECT_NAME, string EFFECT_TYPE)
|
|
{
|
|
PackedScene scene = ResourceLoader.Load<PackedScene>("res://Gameplay/Effects/"+EFFECT_TYPE+"/"+EFFECT_NAME+".tscn");
|
|
Effect instance = scene.Instantiate<Effect>();
|
|
|
|
AddChild(instance);
|
|
Effect newEffect = (Effect)GetChildren().Single(c=>c==instance);
|
|
|
|
newEffect.SetContact(this);
|
|
// TimeEffect1 newEffect = scene.Instantiate();
|
|
// AddChild(newEffect);
|
|
// GD.Print(newEffect);
|
|
// newEffect._contact = this;
|
|
// _effects.Add(newEffect);
|
|
}
|
|
|
|
public void PassNumber(int NUMBER)
|
|
{
|
|
_number = NUMBER;
|
|
}
|
|
|
|
public virtual void Start()
|
|
{
|
|
_effects.ForEach(e=>e.Start());
|
|
}
|
|
}
|