92 lines
1.7 KiB
C#
92 lines
1.7 KiB
C#
using BitStrap;
|
|
using UnityEngine;
|
|
|
|
public class FishingPlayerRemoteInteractive : vp_Interactable
|
|
{
|
|
public GameObject Target;
|
|
|
|
public string TargetMessage = string.Empty;
|
|
|
|
public FishingPlayerRemote fishingPlayerRemote;
|
|
|
|
[ReadOnly]
|
|
public bool canInteract = true;
|
|
|
|
[HideInInspector]
|
|
public MeshRenderer meshRenderer;
|
|
|
|
protected override void Start()
|
|
{
|
|
m_InteractCrosshair = null;
|
|
meshRenderer = GetComponent<MeshRenderer>();
|
|
base.Start();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (!FisheryEditor.Instance)
|
|
{
|
|
}
|
|
}
|
|
|
|
public override void UpdateSeeing(bool isSeeing)
|
|
{
|
|
if (isSeeingMe != isSeeing)
|
|
{
|
|
GameController.Instance.hudManager.hudMultiplayer.ShowRemotePlayerInfo(isSeeing, fishingPlayerRemote);
|
|
Debug.Log("isSeeing RemotePlayer: " + isSeeing);
|
|
if (isSeeing && fishingPlayerRemote.steamUser != null && fishingPlayerRemote.steamUser.friendName == "[unknown]")
|
|
{
|
|
fishingPlayerRemote.RequestSteamStats();
|
|
}
|
|
fishingPlayerRemote.SetAvatarFade(!isSeeing);
|
|
base.UpdateSeeing(isSeeing);
|
|
}
|
|
}
|
|
|
|
public override bool TryInteract(vp_PlayerEventHandler player)
|
|
{
|
|
FishingPlayer fishingPlayer = GameController.Instance.fishingPlayer;
|
|
if (fishingPlayer.currentHands.baitWasThrown)
|
|
{
|
|
return false;
|
|
}
|
|
if (!UtilitiesInput.GetButtonDown("SHOW_REMOTE_PLAYER_INFO"))
|
|
{
|
|
return false;
|
|
}
|
|
if (player != null)
|
|
{
|
|
return false;
|
|
}
|
|
if (!isSeeingMe)
|
|
{
|
|
return false;
|
|
}
|
|
if (!canInteract)
|
|
{
|
|
return false;
|
|
}
|
|
if (m_Player == null && player != null)
|
|
{
|
|
m_Player = player;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public void ShowVisual(bool show)
|
|
{
|
|
if ((bool)meshRenderer)
|
|
{
|
|
meshRenderer.enabled = show;
|
|
}
|
|
}
|
|
|
|
protected override void OnTriggerEnter(Collider col)
|
|
{
|
|
if (InteractType == vp_InteractType.Trigger)
|
|
{
|
|
}
|
|
}
|
|
}
|