41 lines
657 B
C#
41 lines
657 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class Door : Node2D
|
|
{
|
|
[ExportGroup("text")]
|
|
[Export] string text_char;
|
|
[Export] string answerA;
|
|
[Export] string answerB;
|
|
[Export] bool answerA_good;
|
|
bool player_in = false;
|
|
public override void _Ready()
|
|
{
|
|
}
|
|
|
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
public override void _Process(double delta)
|
|
{
|
|
|
|
if(player_in && Input.IsActionPressed("interact"))
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
public void BodyEntered(Node body)
|
|
{
|
|
if(body is CharacterBody2D)
|
|
{
|
|
player_in = true;
|
|
}
|
|
}
|
|
public void BodyExited(Node body)
|
|
{
|
|
if(body is CharacterBody2D)
|
|
{
|
|
player_in = false;
|
|
}
|
|
}
|
|
}
|