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


C# TileMap.DetectVisability方法代码示例

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


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

示例1: Initialise

    public void Initialise()
    {
        map = GetComponent<TileMap>();
        effectLibrary = GetComponent<PrefabLibrary> ();

        activeUnits = new List<GameObject> ();
        everyUnit = new List<GameObject> ();
        currentQueue = new List<GameObject> ();
        currentDisplaying = Display.Movement;

        enemies = new GameObject[MAXENEMIES];
        playerUnitObjects = new GameObject[MAXCHARACTERS];
        loadEnemies ();
        loadCharacters ();

        //temp
        spawnUnit (5, 1, CharacterClass.Warrior);
        spawnUnit (4, 1, CharacterClass.Highwayman);
        spawnUnit (3, 1, CharacterClass.Ranger);
        spawnUnit (2, 1, CharacterClass.Elementalist);
        spawnUnit (1, 1, CharacterClass.Acolyte);

        GetComponent<GameManager> ().UI.GetComponent<UIManager> ().SetupUnitFrames (playerUnitObjects);

        //spawnEnemy (4, 2, EnemyClass.Goblin);
        List<Unit> squad = new List<Unit> ();

        squad.Add(spawnEnemy (42, 4, EnemyClass.GoblinShaman));

        foreach (Unit u in squad) {
            u.GetComponent<AIBehaviours>().myGroup = squad;
        }

        squad = new List<Unit> ();
        squad.Add(spawnEnemy (15, 4, EnemyClass.GoblinAxeThrower));
        squad.Add(spawnEnemy (15, 5, EnemyClass.Goblin));
        squad.Add(spawnEnemy (17, 1, EnemyClass.Goblin));
        squad.Add(spawnEnemy (15, 8, EnemyClass.GoblinAxeThrower));

        foreach (Unit u in squad) {
            u.GetComponent<AIBehaviours>().myGroup = squad;
        }

        squad = new List<Unit> ();
        squad.Add(spawnEnemy (21, 4, EnemyClass.GoblinDrummer));
        squad.Add(spawnEnemy (25, 8, EnemyClass.GoblinAxeThrower));
        squad.Add(spawnEnemy (26, 1, EnemyClass.GoblinAxeThrower));
        squad.Add(spawnEnemy (26, 4, EnemyClass.Goblin));
        squad.Add(spawnEnemy (27, 4, EnemyClass.Goblin));

        foreach (Unit u in squad) {
            u.GetComponent<AIBehaviours>().myGroup = squad;
        }

        activeUnits.Sort(CompareListByInitiative);

        foreach (GameObject go in activeUnits) {
            currentQueue.Add(go);
        }

        //set the starting vision
        foreach (GameObject go in playerUnitObjects) {
            map.DetectVisability(go.GetComponent<Unit>());
        }

        GetComponentInChildren<UIManager> ().ChangeRound (currentQueue);

        NextUnitsTurn ();
    }
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:69,代码来源:UnitManager.cs


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