49 lines
880 B
C#
49 lines
880 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class InteractiveObject : vp_Interactable
|
|
{
|
|
[Serializable]
|
|
public class Information
|
|
{
|
|
public List<GameObject> targets = new List<GameObject>();
|
|
|
|
public string message = string.Empty;
|
|
}
|
|
|
|
public List<Information> informTargets = new List<Information>();
|
|
|
|
protected override void Start()
|
|
{
|
|
base.Start();
|
|
}
|
|
|
|
public override bool TryInteract(vp_PlayerEventHandler player)
|
|
{
|
|
if (informTargets.Count == 0)
|
|
{
|
|
return false;
|
|
}
|
|
if (m_Player == null)
|
|
{
|
|
m_Player = player;
|
|
}
|
|
foreach (Information informTarget in informTargets)
|
|
{
|
|
foreach (GameObject target in informTarget.targets)
|
|
{
|
|
target.SendMessage(informTarget.message);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
protected override void OnTriggerEnter(Collider col)
|
|
{
|
|
if (InteractType == vp_InteractType.Trigger)
|
|
{
|
|
}
|
|
}
|
|
}
|