//初始化方法 public Unit(object sprite, Vector2 speed, Vector2 locate, float ringSize, float enemySize,float enemySize2, AIBase.FaceSide face, AIBase.ID id) : base(sprite) { //四个输入参数 Speed = speed; m_locate = locate; Face = face; Id = id; RingSize = ringSize; EnemySize = enemySize; CoolDownTime = 0; CurrentFly = 0; EnemySize2 = enemySize; CurrentDialog = AIBase.StatusDialog.Blank; StatusColor = Color.AliceBlue; StatusPostion = new Vector2(0); //放在开始位置 StartPoint = locate; //默认在Normal状态 Status = AIBase.Status.Normal; LastStatus = AIBase.Status.Blank; //默认不旋转 Rotate = 0f; this.CurrentRing = 0; //表初始化 ListLeft = new List<PicList>(); ListRight = new List<PicList>(); ListTurnLeft = new List<PicList>(); ListTurnRight = new List<PicList>(); List = new List<PicList>(); ListRing = new List<PicList>(); //中心位置 Center = new Vector2(enemySize / 2, enemySize / 2); }
internal void ToNormalStatus(GameTime gameTime, Player ptr) { if ((this.Locate - AIBase.Player.Locate).Length() > 400) { this.CurrentDialog = AIBase.StatusDialog.Blank; this.Status = AIBase.Status.Normal; } }