当前位置: 首页>>代码示例>>C#>>正文


C# DataManager.GetCurrentSectorData方法代码示例

本文整理汇总了C#中DataManager.GetCurrentSectorData方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.GetCurrentSectorData方法的具体用法?C# DataManager.GetCurrentSectorData怎么用?C# DataManager.GetCurrentSectorData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataManager的用法示例。


在下文中一共展示了DataManager.GetCurrentSectorData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

    void Start()
    {
        planetFactory = GameObject.FindObjectOfType<PlanetFactory>();
        gm = GameObject.FindObjectOfType<GameManager>();
        dm = GameObject.FindObjectOfType<DataManager>();
        player = GameObject.FindObjectOfType<Player>();
        
        for (int i = 0; i < sectorTiles.Length; i++)
        {
            sectorTiles[i] = new SectorTile();
            sectorTiles[i].index = i;
            //sectorTiles[i].x = -8f + 3.2f * i;
            sectorTiles[i].onSector = null;
        }
        sectorTiles[0].firstSeat = new Vector2(-1000, -800)/100f;
        sectorTiles[0].secondSeat = new Vector2(-1000, -800) / 100f;
        sectorTiles[0].thirdSeat = new Vector2(-1000, -800) / 100f;
        sectorTiles[0].fourthSeat = new Vector2(-1000, -800) / 100f;
        sectorTiles[0].fifthSeat = new Vector2(-1000, -800) / 100f;

        sectorTiles[1].firstSeat = new Vector2(-800, -500) / 100f;
        sectorTiles[1].secondSeat = new Vector2(-800, -500) / 100f;
        sectorTiles[1].thirdSeat = new Vector2(-512, -198) / 100f;
        sectorTiles[1].fourthSeat = new Vector2(-800, -500) / 100f;
        sectorTiles[1].fifthSeat = new Vector2(-800, -500) / 100f;

        sectorTiles[2].firstSeat = new Vector2(-512, 114) / 100f;
        sectorTiles[2].secondSeat = new Vector2(-386, 96) / 100f;
        sectorTiles[2].thirdSeat = new Vector2(-255, 10) / 100f;
        sectorTiles[2].fourthSeat = new Vector2(-188, -117) / 100f;
        sectorTiles[2].fifthSeat = new Vector2(-175, -207) / 100f;

        sectorTiles[3].firstSeat = new Vector2(-23, 255) / 100f;
        sectorTiles[3].secondSeat = new Vector2(47, 139) / 100f;
        sectorTiles[3].thirdSeat = new Vector2(90, 64) / 100f;
        sectorTiles[3].fourthSeat = new Vector2(119, -30) / 100f;
        sectorTiles[3].fifthSeat = new Vector2(134, -117) / 100f;

        sectorTiles[4].firstSeat = new Vector2(368, 258) / 100f;
        sectorTiles[4].secondSeat = new Vector2(430, 150) / 100f;
        sectorTiles[4].thirdSeat = new Vector2(452, 80) / 100f;
        sectorTiles[4].fourthSeat = new Vector2(470, -10) / 100f;
        sectorTiles[4].fifthSeat = new Vector2(486, -95) / 100f;

        sectorTiles[5].firstSeat = new Vector2(800, 500) / 100f;
        sectorTiles[5].secondSeat = new Vector2(800, 500) / 100f;
        sectorTiles[5].thirdSeat = new Vector2(800, 500) / 100f;
        sectorTiles[5].fourthSeat = new Vector2(800, 500) / 100f;
        sectorTiles[5].fifthSeat = new Vector2(800, 500) / 100f;

        for (int i = 0; i < sectors.Length; i++)
        {
            sectors[i] = Instantiate(sector);
            sectors[i].gameObject.SetActive(false);
        }

        for (int i = 0; i < 6; i++)
        {
            if (i == 1)
                continue;
            Sector s = CreateSector();
            s.SetSectorTile(sectorTiles[i]);
            for (int j = 0; j < s.transform.childCount; j++)
                s.transform.GetChild(j).position = s.transform.GetChild(j).GetComponent<PlanetBase>().targetPos;
        }
        startSector.SetSectorTile(sectorTiles[1]);
        for (int i = 0; i < startSector.transform.childCount; i++)
            startSector.transform.GetChild(i).position = startSector.transform.GetChild(i).GetComponent<PlanetBase>().targetPos;

        ProbabilityRevision();

        sectorData = dm.GetCurrentSectorData(currentSector);
    }
开发者ID:penspanic,项目名称:SpaceOdyssey,代码行数:73,代码来源:SectorManager.cs


注:本文中的DataManager.GetCurrentSectorData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。