Beispiel #1
0
        /// <summary>
        /// 计算Aoe区域
        /// </summary>
        /// <returns></returns>
        public Shape CalcArea()
        {
            if (ower == null)
            {
                if (size != 1)
                {
                    Shape newShape = model.areaShape;
                    newShape.Scale(size);
                    return(newShape);
                }
                return(model.areaShape);
            }
            else
            {
                if (!follow && size == 1)
                {
                    return(model.areaShape);
                }

                Shape newShape = model.areaShape;
                if (size != 1)
                {
                    newShape.Scale(size);
                }
                if (follow)
                {
                    ActorObj actorObj = MapLocate.Map.GetActor(ower.EntityId);
                    if (actorObj == null)
                    {
                        SkillLocate.Log.LogError("计算区域出错,没有跟随对象>>", model.id, ower.EntityId);
                    }
                    if (actorObj.GetDir() == DirType.Left)
                    {
                        newShape.FlipX();
                    }
                    newShape.Translate(actorObj.transform.position);
                }
                return(newShape);
            }
        }