public virtual void OnStart()
 {
     if (Object.op_Equality((Object)(this.targetPoint = this.TargetInSightMerchantPoint), (Object)null))
     {
         this.targetPoint = this.CurrentMerchantPoint;
     }
     this.mainTargetPoint = this.MainTargetInsightMerchantPoint;
 }
Exemplo n.º 2
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            MerchantPoint sightMerchantPoint = this.TargetInSightMerchantPoint;

            this.CurrentMerchantPoint = sightMerchantPoint;
            if (Object.op_Equality((Object)sightMerchantPoint, (Object)null))
            {
                MerchantPoint exitPoint = this.Merchant.ExitPoint;
                this.TargetInSightMerchantPoint = exitPoint;
                this.CurrentMerchantPoint       = exitPoint;
            }
            this._currentPoint = this.CurrentMerchantPoint;
            if (this.prevTalkable = this.Merchant.Talkable)
            {
                this.Merchant.Talkable = false;
            }
            if (this.Merchant.ChaControl.visibleAll || Object.op_Inequality((Object)this._currentPoint, (Object)null) && this._currentPoint.AnyActiveItemObjects())
            {
                this.CrossFade();
            }
            this.Merchant.Hide();
            if (Object.op_Inequality((Object)this._currentPoint, (Object)null))
            {
                this._currentPoint.HideItemObjects();
            }
            this.Merchant.DeactivateNavMeshElement();
            this.Merchant.Animation.StopAllAnimCoroutine();
            this.Merchant.Animation.Animator.Play(Singleton <Resources> .Instance.DefinePack.AnimatorState.MerchantIdleState, 0);
            string forwardMove = Singleton <Resources> .Instance.DefinePack.AnimatorParameter.ForwardMove;

            foreach (AnimatorControllerParameter parameter in this.Merchant.Animation.Animator.get_parameters())
            {
                if (parameter.get_name() == forwardMove && parameter.get_type() == 1)
                {
                    this.Merchant.Animation.Animator.SetFloat(forwardMove, 0.0f);
                }
            }
            if (Object.op_Equality((Object)this._currentPoint, (Object)null))
            {
                return;
            }
            this.Merchant.SetPointIDInfo(this.CurrentMerchantPoint);
            Tuple <MerchantPointInfo, Transform, Transform> eventInfo = this.CurrentMerchantPoint.GetEventInfo(Merchant.EventType.Wait);

            this.Merchant.Position = eventInfo.Item2.get_position();
            this.Merchant.Rotation = eventInfo.Item2.get_rotation();
        }
        public virtual TaskStatus OnUpdate()
        {
            if (Object.op_Equality((Object)this.targetPoint, (Object)null))
            {
                return((TaskStatus)1);
            }
            MerchantPoint merchantPoint = !Object.op_Inequality((Object)this.mainTargetPoint, (Object)null) ? this.targetPoint : this.mainTargetPoint;

            if (this.Merchant.OpenAreaID < merchantPoint.AreaID)
            {
                return((TaskStatus)1);
            }
            Merchant.EventType eventType = merchantPoint.EventType;
            if (!NavMesh.CalculatePath(this.Merchant.Position, this.targetPoint.Destination, this.Merchant.NavMeshAgent.get_areaMask(), this.navMeshPath) || this.navMeshPath.get_status() != null)
            {
                return((TaskStatus)1);
            }
            return((eventType & this._matchType) == this._matchType ? (TaskStatus)2 : (TaskStatus)1);
        }
Exemplo n.º 4
0
        private bool IsMatchPoint(MerchantPoint _point, bool _isMiddlePoint)
        {
            if (Object.op_Equality((Object)_point, (Object)null))
            {
                return(false);
            }
            Merchant.EventType eventType    = !_isMiddlePoint ? Merchant.EventType.Search : Merchant.EventType.Wait;
            MerchantActor      merchant     = this.Merchant;
            MerchantData       merchantData = merchant.MerchantData;
            int           openAreaId        = merchant.OpenAreaID;
            int           pointAreaId       = merchantData.PointAreaID;
            int           pointGroupId      = merchantData.PointGroupID;
            MerchantPoint prevMerchantPoint = this.PrevMerchantPoint;

            if (openAreaId < _point.AreaID || (_point.EventType & eventType) != eventType || _point.AreaID != pointAreaId)
            {
                return(false);
            }
            if (_isMiddlePoint)
            {
                return(_point.GroupID == 0);
            }
            return(_point.GroupID != pointGroupId || Object.op_Inequality((Object)_point, (Object)prevMerchantPoint));
        }
Exemplo n.º 5
0
 private bool IsSameArea(MerchantPoint _point0, MerchantPoint _point1)
 {
     return(!Object.op_Equality((Object)_point0, (Object)null) && !Object.op_Equality((Object)_point1, (Object)null) && _point0.AreaID == _point1.AreaID);
 }