示例#1
0
        private void MoveBlockCheck()
        {
            if (queue_position_x.Count >= 32)
            {
                queue_position_x.Dequeue();
            }

            queue_position_x.Enqueue(character.transform.position.x);

            if (queue_position_x.Count >= 32 && queue_position_x.Max() - queue_position_x.Min() < 0.1f)
            {
                if (RandomUtils.RandomBool())
                {
                    isMoveBlocking = true;
                    //character.Move.Idle();

                    DelayTask.Invoke(() =>
                    {
                        isMoveBlocking = false;
                        queue_position_x.Clear();
                    }, RandomUtils.RandomMinMax(500, 2000));
                }
                else
                {
                    GoToNextPatrolPoint();
                }
            }
        }
示例#2
0
 private void AliveCountdown(int aliveTime)
 {
     taskAliveCountdown?.Release();
     taskAliveCountdown = DelayTask.Invoke(() =>
     {
         if (this.gameObject != null)
         {
             GameObject.Destroy(this.gameObject);
         }
     }, aliveTime);
 }