Exemple #1
0
    protected override void OnPEDestroy()
    {
        StopAllCoroutines();

        DragArticleAgent.Destory(Id);

        if (null != _flagPos)
        {
            PeMap.LabelMgr.Instance.Remove(_flagPos);
            _flagPos = null;
        }

        int index = PeMap.MaskTile.Mgr.Instance.GetMapIndex(transform.position);

        PeMap.MaskTile mt = PeMap.MaskTile.Mgr.Instance.Get(index);
        if (null != mt)
        {
            mt.forceGroup = -1;
            PeMap.MaskTile.Mgr.Instance.Add(index, mt);
        }

        if (null == Runner)
        {
            return;
        }

        Destroy(Runner.gameObject);
    }
Exemple #2
0
        public static void Load()
        {
            SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("MapIcon");

            while (reader.Read())
            {
                StaticPoint point = new StaticPoint();
                point.ID     = reader.GetInt32(0);
                point.textId = Convert.ToInt32(reader.GetString(1));
                string[] posStr = reader.GetString(2).Split(',');
                point.position = new Vector3(Convert.ToSingle(posStr[0]), Convert.ToSingle(posStr[1]), Convert.ToSingle(posStr[2]));
                point.icon     = Convert.ToInt32(reader.GetString(3));
                point.distance = Convert.ToSingle(reader.GetString(4));
                point.campId   = Convert.ToInt32(reader.GetString(5));
                if (point.campId >= 0)
                {
                    point.fastTravel = true;
                }
                else
                {
                    point.fastTravel = false;
                }

                point.soundID = Convert.ToInt32(reader.GetString(6));
                StaticPoint.Mgr.Instance.Add(point);
            }
        }
Exemple #3
0
 public bool CompareTo(ILabel label)
 {
     if (label is StaticPoint)
     {
         StaticPoint staticPointlabel = (StaticPoint)label;
         if (this.ID == staticPointlabel.ID)
         {
             return(true);
         }
         return(false);
     }
     else
     {
         return(false);
     }
 }
Exemple #4
0
        public static void StaticPointBeFound(int id)
        {
            StaticPoint tmp = StaticPoint.Mgr.Instance.Find(delegate(StaticPoint sp)
            {
                if (sp.ID == id)
                {
                    return(true);
                }
                return(false);
            });

            if (tmp != null && tmp.discoverd == false)
            {
                tmp.discoverd = true;
                tmp.AddToLabelMgr();
            }
        }
    void RemoveFlag()
    {
        if (null != _flagPos)
        {
            PeMap.LabelMgr.Instance.Remove(_flagPos);
            _flagPos = null;
        }

        if (!Pathea.PeGameMgr.IsStory && !Pathea.PeGameMgr.IsCustom)
        {
            int            index = PeMap.MaskTile.Mgr.Instance.GetMapIndex(transform.position);
            PeMap.MaskTile mt    = PeMap.MaskTile.Mgr.Instance.Get(index);
            if (null != mt)
            {
                mt.forceGroup = -1;
                PeMap.MaskTile.Mgr.Instance.Add(index, mt);
            }
        }
    }
Exemple #6
0
    void RPC_SO_InitData(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        ItemAsset.ItemObject itemObj = stream.Read <ItemAsset.ItemObject>();
        transform.position = stream.Read <Vector3>();
        transform.rotation = stream.Read <Quaternion>();

        if (null == itemObj)
        {
            return;
        }

        ItemAsset.Drag drag = itemObj.GetCmpt <ItemAsset.Drag>();
        if (null == drag)
        {
            return;
        }

        DragArticleAgent item = DragArticleAgent.Create(drag, transform.position, transform.localScale, transform.rotation, Id, this);

        if (item.itemLogic != null)
        {
            DragItemLogicFlag flag = item.itemLogic as DragItemLogicFlag;
            if (flag != null)
            {
                _entity = Pathea.EntityMgr.Instance.Get(Id);
                OnSpawned(flag.gameObject);
            }
        }

        if (null == _flagPos)
        {
            _flagPos            = new PeMap.StaticPoint();
            _flagPos.icon       = PeMap.MapIcon.FlagIcon;
            _flagPos.fastTravel = true;
            _flagPos.text       = "Flag_" + Id;
            //_flagPos.campId = TeamId;
            _flagPos.position = transform.position;

            PeMap.LabelMgr.Instance.Add(_flagPos);
        }

        StartCoroutine(RefreshFlag());
    }
    void AddFlag()
    {
        if (null == _flagPos)
        {
            _flagPos            = new PeMap.StaticPoint();
            _flagPos.ID         = Id;
            _flagPos.icon       = PeMap.MapIcon.FlagIcon;
            _flagPos.fastTravel = true;
            _flagPos.text       = "Flag_" + Id;
            _flagPos.position   = _pos;

            PeMap.LabelMgr.Instance.Add(_flagPos);
        }

        if (!Pathea.PeGameMgr.IsStory && !Pathea.PeGameMgr.IsCustom)
        {
            int            index = PeMap.MaskTile.Mgr.Instance.GetMapIndex(_pos);
            PeMap.MaskTile mt    = PeMap.MaskTile.Mgr.Instance.Get(index);
            if (null != mt)
            {
                mt.forceGroup = TeamId;
            }
            else
            {
                Vector2 tilePos = PeMap.MaskTile.Mgr.Instance.GetCenterPos(index);
                byte    type    = PeMap.MaskTile.Mgr.Instance.GetType((int)tilePos.x, (int)tilePos.y);

                mt            = new PeMap.MaskTile();
                mt.index      = index;
                mt.forceGroup = TeamId;
                mt.type       = type;
            }

            PeMap.MaskTile.Mgr.Instance.Add(index, mt);
        }
    }