예제 #1
0
        private void Start()
        {
            attr        = GetComponent <NpcAttribute>();
            aiBase      = GetComponent <AIBase>();
            vcontroller = GetComponent <MoveController>().vcontroller;

            gameObject.AddComponent <DebugServerPos>();
        }
예제 #2
0
 private void NetworkMove(EntityInfo info)
 {
     if (aibase == null)
     {
         aibase = gameObject.GetComponent <AIBase>();
     }
     if (aibase != null)
     {
         var aiState = aibase.GetAI().state;
         if (aiState != null && aiState.type == AIStateEnum.IDLE)
         {
             var curPos = transform.position;
             var tarPos = NetworkUtil.FloatPos(info.X, info.Y, info.Z);
             var vdir   = tarPos - curPos;
             if (vdir.sqrMagnitude >= 2)
             {
                 transform.position = tarPos;
             }
         }
     }
 }