示例#1
0
        public ItemSpawner(HexData.Addition data)
        {
            count = data.count;
            kind = data.kind;
            itemType = data.type;
            minRespTime = data.minRespawnTime;
            maxRespTime = data.maxRespawnTime;
            firstSpawn = data.respawnOnStart;

            roundCounter = 0;
            requiredRound = URandom.Range(minRespTime, maxRespTime + 1);
        }
示例#2
0
文件: Hex.cs 项目: Rupini/Hexocracy
        //public int indexX;
        //public int indexY;
        //public int h;
        //public ContentType cType;
        public void Initialize(HexData data)
        {
            additions = new List<IHexAddition>();
            map = GameServices.Get<GameMap>();
            nihility = GameServices.Get<Nihility>();

            //indexX = data.xIndex;
            //indexY = data.yIndex;
            //h = data.height;

            SetIndex(new Index2D(data.xIndex, data.yIndex));
            H = data.height;
            t.localScale = new Vector3(t.localScale.x, data.scaleY, t.localScale.z);

            GroundCenter = new Vector3(t.position.x, t.position.y + r.bounds.size.y * 0.5f, t.position.z);

            if (data.hasAddition)
            {
                AddAddition(new ItemSpawner(data.addition));
            }

            Content = EmptyContent.Get();
        }