blob: 9d671f4731966b5a8e61072140a06bc69eb5114a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
using UnityEngine;
using System.Collections;
using XUtliPoolLib;
public class XOpenFishingUI : MonoBehaviour {
private IXPlayerAction _uiOperation;
int m_SeatIndex = 0;
void Awake()
{
m_SeatIndex = int.Parse(gameObject.name.Substring(gameObject.name.Length - 1, 1));
}
void OnTriggerEnter(Collider c)
{
if (c.gameObject.CompareTag("Player"))
{
if (_uiOperation == null || _uiOperation.Deprecated)
_uiOperation = XInterfaceMgr.singleton.GetInterface<IXPlayerAction>(1);
if (_uiOperation != null) _uiOperation.GotoFishing(m_SeatIndex, true);
}
}
void OnTriggerStay(Collider c)
{
if (c.gameObject.CompareTag("Player"))
{
if (_uiOperation == null || _uiOperation.Deprecated)
_uiOperation = XInterfaceMgr.singleton.GetInterface<IXPlayerAction>(1);
if (_uiOperation != null) _uiOperation.GotoFishing(m_SeatIndex, true);
}
}
void OnTriggerExit(Collider c)
{
if (c.gameObject.CompareTag("Player"))
{
if (_uiOperation == null || _uiOperation.Deprecated)
_uiOperation = XInterfaceMgr.singleton.GetInterface<IXPlayerAction>(1);
if (_uiOperation != null) _uiOperation.GotoFishing(m_SeatIndex, false);
}
}
}
|