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


C# Level.Init方法代码示例

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


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

示例1: Init

	public void Init () {
    level = new Level();
    level.Init();
		player = new Player();
    player.pos = level.playerTile;
    player.rotation = level.playerRotation;
		turn = Turn.None;
    enemies = new List<Enemy>();
	}
开发者ID:britg,项目名称:Troped,代码行数:9,代码来源:Game.cs

示例2: LoadLevel

    void LoadLevel(int level)
    {
        GameObject go = LoadResource("Prefab/LevelPrefab",true) as GameObject;
        if (go != null)
        {
            go.transform.SetParent(UIRoot.transform);
            go.transform.localPosition = Vector3.zero;

            CurLevel = go.GetComponent<Level>();
            CurLevel.Init(8, 7,null);
            GetInstance().CurLevel.Shuffle();
        }
    }
开发者ID:JackyCBN,项目名称:CandyLike,代码行数:13,代码来源:GameRoot.cs

示例3: LoadLevel

 private void LoadLevel()
 {
     if (level != null) level.abilityPanel.DeselectAbility(level.abilityPanel.activeAbility, false);
     UpdateMystery();
     previousLevel = level;
     if (previousLevel != null) {
         previousLevel.SlideAway();
     }
     Texture2D levelData = GetLevelData(levelNumber);
     if (levelData == null) {
         EndScreen();
         return;
     }
     GameObject go = new GameObject("level parent");
     PlayerPrefs.SetInt("level", levelNumber);
     level = go.AddComponent<Level>();
     level.Init(levelData);
     level.SlideIn();
 }
开发者ID:ColourTann,项目名称:DotGobbler,代码行数:19,代码来源:Game.cs

示例4: InitSimulation

        protected override void InitSimulation(int seed, LevelInfo level, PlayerInfo[] players, Slot[] slots)
        {
            Assembly levelAssembly = Assembly.Load(level.Type.AssemblyFile);
            Type levelType = levelAssembly.GetType(level.Type.TypeName);

            SimulationContext context = new SimulationContext(
                ExtensionLoader.DefaultTypeResolver,
                ExtensionLoader.ExtensionSettings);

            simulation = Activator.CreateInstance(levelType, context) as Level;

            // Player erzeugen
            LevelSlot[] levelSlots = new LevelSlot[AntMe.Level.MAX_SLOTS];
            for (int i = 0; i < AntMe.Level.MAX_SLOTS; i++)
            {
                // Skipp, falls nicht vorhanden
                if (players[i] == null)
                    continue;

                Assembly playerAssembly = Assembly.Load(players[i].Type.AssemblyFile);
                Type factoryType = playerAssembly.GetType(players[i].Type.TypeName);

                // Identify Name
                var playerAttributes = factoryType.GetCustomAttributes(typeof(FactoryAttribute), true);
                if (playerAttributes.Length != 1)
                    throw new Exception("Player does not have the right number of Player Attributes");

                FactoryAttribute playerAttribute = playerAttributes[0] as FactoryAttribute;

                // Find the right Mapping
                var mappingAttributes = playerAttribute.GetType().
                    GetCustomAttributes(typeof(FactoryAttributeMappingAttribute), false);
                if (mappingAttributes.Length != 1)
                    throw new Exception("Player Attribute has no valid Property Mapping Attribute");

                FactoryAttributeMappingAttribute mappingAttribute = mappingAttributes[0] as FactoryAttributeMappingAttribute;

                // Werte auslesen
                string name = playerAttribute.GetType().GetProperty(mappingAttribute.NameProperty).
                    GetValue(playerAttribute, null) as string;

                levelSlots[i] = new LevelSlot()
                {
                    FactoryType = factoryType,
                    Name = name,
                    Color = slots[i].ColorKey,
                    Team = slots[i].Team
                };
            }

            // Level initialisieren
            simulation.Init(seed, levelSlots);
        }
开发者ID:FrankFlamme,项目名称:AntMeCore,代码行数:53,代码来源:UnsecureSimulationClient.cs


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