示例#1
0
    // Use this for initialization
    void Awake()
    {
        _box         = GetComponent <BoxCollider>();
        _box.enabled = false;
        _interface   = new PlayerAction();
        Vector3 half = Vector3.Cross(Vector3.up, transform.forward) * _box.size.x * _box.transform.localScale.x * 0.5f;

        _left  = _box.center + _box.transform.position - half;
        _right = _box.center + _box.transform.position + half;
    }
 private void OnTriggerEnter(Collider c)
 {
     if (c.gameObject.CompareTag("Player"))
     {
         if (this._uiOperation == null || this._uiOperation.Deprecated)
         {
             this._uiOperation = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXPlayerAction>(1u);
         }
         if (this._uiOperation != null)
         {
             this._uiOperation.GotoTerritoryBattle(this.index);
         }
     }
 }
示例#3
0
 private void OnTriggerExit(Collider c)
 {
     if (c.gameObject.CompareTag("Player"))
     {
         if (this._uiOperation == null || this._uiOperation.Deprecated)
         {
             this._uiOperation = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXPlayerAction>(1u);
         }
         if (this._uiOperation != null)
         {
             this._uiOperation.GotoFishing(this.m_SeatIndex, false);
         }
     }
 }
示例#4
0
 private void Update()
 {
     if (this._interface == null || this._interface.Deprecated)
     {
         this._interface = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXPlayerAction>(1u);
     }
     if (this._interface != null && this._interface.IsValid)
     {
         Vector3 vector = this._interface.PlayerPosition(true);
         Vector3 a      = this._interface.PlayerLastPosition(true);
         if ((a - vector).sqrMagnitude > 0f)
         {
             this.CollisionDetected(vector);
         }
     }
 }