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


C# CharacterType类代码示例

本文整理汇总了C#中CharacterType的典型用法代码示例。如果您正苦于以下问题:C# CharacterType类的具体用法?C# CharacterType怎么用?C# CharacterType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GenerateStringTypeTests

        public void GenerateStringTypeTests()
        {
            FastRandom fr = new FastRandom();
            CharacterType[] types = new CharacterType[] { CharacterType.LowerCase, CharacterType.UpperCase, CharacterType.Numeric };
            Func<char, bool>[] actions = new Func<char, bool>[] { Char.IsLower, Char.IsUpper, Char.IsNumber };
            for(int i = 0; i < types.Length; i++)
            {
                for(int j = 0; j < 1000; j++)
                {
                    var s = fr.NextString(5, types[i]);
                    Assert.Equal(5, s.Length);
                    foreach(var c in s)
                    {
                        Assert.True(actions[i](c));
                    }
                }
            }
            {
                var s = fr.NextString(5, CharacterType.Special);
                Assert.Equal(5, s.Length);
                foreach(var c in s)
                {
                    Assert.True(FastRandom.SpecialCharacters.Contains(c));
                }
            }

        }
开发者ID:glorylee,项目名称:Aoite,代码行数:27,代码来源:FastRandomTests.cs

示例2: OnTriggerExit

 void OnTriggerExit(Collider other)
 {
     if (other.gameObject.CompareTag ("Player")) {
         confirm.text = "";
         selected = CharacterType.None;
     }
 }
开发者ID:soxies1,项目名称:Sisyphean-Prolix,代码行数:7,代码来源:ClassSelectPad.cs

示例3: OnTriggerEnter

 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag ("Player")) {
         tag = gameObject.tag;
         switch(tag){
         case ("AssassinPad"):
             confirm.text = "Take the Path of the Assassin?\n (y)";
             selected = CharacterType.Assassin;
             Debug.Log (gameObject.tag);
             break;
         case ("WarriorPad"):
             confirm.text = "Take the Path of the Warrior?\n (y)";
             selected = CharacterType.Warrior;
             Debug.Log (gameObject.tag);
             break;
         case ("RangerPad"):
             confirm.text = "Take the Path of the Ranger?\n (y)";
             selected = CharacterType.Ranger;
             Debug.Log (gameObject.tag);
             break;
         case ("MagePad"):
             confirm.text = "Take the Path of the Mage?\n (y)";
             selected = CharacterType.Mage;
             Debug.Log (gameObject.tag);
             break;
         }
         //other.gameObject.SetActive(false);
         //Debug.Log (gameObject);
         //Debug.Log ("Entered pad Trigger");
     }
 }
开发者ID:soxies1,项目名称:Sisyphean-Prolix,代码行数:31,代码来源:ClassSelectPad.cs

示例4: Pool

 public Pool(CharacterType ctype) {
     switch (ctype) {
         case CharacterType.PikeMan:
             m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/pike_effect");
             break;
     }
 }
开发者ID:dev-celvin,项目名称:DoubleKatana,代码行数:7,代码来源:Pool.cs

示例5: add

        /**
         * Appends a new character to the end of the buffer.
         *
         * @param characterType
         *            the type of Arabic letter or Quranic symbol to append, such as
         *            <i>Alif</i> or <i>Ba</i>.
         */
        public void add(CharacterType characterType)
        {
            // Check if the buffer is not large enough to support a new character.
            if (characterCount >= characterCapacity)
            {

                // Copy the existing data into a new larger buffer.
                int newCapacity = characterCapacity * 2;
                byte[] newBuffer = new byte[newCapacity
                        * ByteFormat.CHARACTER_WIDTH];
                Array.Copy(buffer, 0, newBuffer, 0, characterCapacity * ByteFormat.CHARACTER_WIDTH);

                // Use the new buffer.
                buffer = newBuffer;
                characterCapacity = newCapacity;
            }

            // Add the character to the end of the buffer.
            int offset = characterCount * ByteFormat.CHARACTER_WIDTH;
            buffer[offset] = characterType != null ? (byte)characterType : ByteFormat.WHITESPACE;
            buffer[offset + 1] = 0;
            buffer[offset + 2] = 0;

            // Increment character count.
            characterCount++;
        }
开发者ID:usmanghani,项目名称:Quantae,代码行数:33,代码来源:ArabicTextBuilder.cs

示例6: Draw

        public static void Draw(ref System.Windows.Forms.PaintEventArgs e, CharacterType type, MovementWay way = MovementWay.Right)
        {
            switch (type)
            {
                case CharacterType.Packman:
                    e.Graphics.Clear(System.Drawing.SystemColors.Control);
                    e.Graphics.FillEllipse(System.Drawing.Brushes.Yellow, 0, 0, 20, 20);
                    e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(6, 7, 3, 3));
                    e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(12, 7, 3, 3));
                    e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(12, 7, 3, 3));
                    e.Graphics.FillEllipse(System.Drawing.Brushes.Black, new System.Drawing.Rectangle(8, 12, 6, 2));
                    break;

                case CharacterType.Enemy:
                    e.Graphics.Clear(System.Drawing.SystemColors.Control);
                    e.Graphics.FillEllipse(System.Drawing.Brushes.Blue, new System.Drawing.Rectangle(0, 0, 20, 25));
                    e.Graphics.FillEllipse(System.Drawing.Brushes.LightYellow, new System.Drawing.Rectangle(4, 8, 3, 3));
                    e.Graphics.FillEllipse(System.Drawing.Brushes.LightYellow, new System.Drawing.Rectangle(13, 8, 3, 3));
                    e.Graphics.FillPolygon(System.Drawing.SystemBrushes.Control,
                                            new System.Drawing.Point[] {
                                                    new System.Drawing.Point(1, 20),
                                                    new System.Drawing.Point(4, 15),
                                                    new System.Drawing.Point(7, 20),
                                                    new System.Drawing.Point(10, 15),
                                                    new System.Drawing.Point(13, 20),
                                                    new System.Drawing.Point(16, 15),
                                                    new System.Drawing.Point(19, 20)});
                    break;
            }
        }
开发者ID:JrPD,项目名称:Pac-Man,代码行数:30,代码来源:DrawCharacter.cs

示例7: SpawnCharacterForPlayer

 void SpawnCharacterForPlayer(Player player, CharacterType type, GameObject spawnPoint)
 {
     Character newCharacter = (Instantiate(characterPrefab, spawnPoint.transform.position, Quaternion.identity) as GameObject).GetComponent<Character>();
     newCharacter.player = player;
     player.character = newCharacter;
     newCharacter.InitializeWithType(type);
 }
开发者ID:highco,项目名称:GlobalGameJam2014,代码行数:7,代码来源:GameController.cs

示例8: DrawTextBox

    public IEnumerator DrawTextBox(string text, float duration, CharacterType Character)
    {
        switch (Character) {
        case CharacterType.Kegan:
            break;
        case CharacterType.Klug:
            break;
        case CharacterType.Melonee:
            ProfilePic.sprite = MeloneePic;
            break;
        case CharacterType.Brentt:
            ProfilePic.sprite = BrenttPic;
            break;
        case CharacterType.Brandon:
            ProfilePic.sprite = BrandonPic;
            break;
        case CharacterType.Chuck:
            ProfilePic.sprite = ChuckPic;
            Debug.Log("ASD");
            break;
        case CharacterType.Nyjel:
            ProfilePic.sprite = NyjelPic;
            break;
        }

        TextBoxText.text = text;
        TextBox.SetActive (true);
        yield return new WaitForSeconds(duration);
        TextBox.SetActive (false);
    }
开发者ID:C453,项目名称:Valdemar,代码行数:30,代码来源:LevelController.cs

示例9: EnemyCharacter

 public EnemyCharacter(CharacterType characterType, MonsterController controller) {
     this.characterType = characterType;
     MovementSpeed = GameProperties.DEFAULT_ENEMY_SPEED;
     this.controller = controller;
     OnDeathAction += OnDeath;
     SetupCharacter();
 }
开发者ID:JoeLee9981,项目名称:GGJ_2016_ritual,代码行数:7,代码来源:EnemyCharacter.cs

示例10: CharacterDefinition

 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterDefinition"/> class.
 /// Creates the animation and frame array and then reads character data from file to fill
 /// all fields
 /// </summary>
 /// <param name="path">The path.</param>
 public CharacterDefinition(String loadPath, CharacterType type)
 {
     Reset();
     Path = loadPath;
     Read();
     CharType = (int)type;
 }
开发者ID:falc410,项目名称:RuinExplorers,代码行数:13,代码来源:CharacterDefinition.cs

示例11: Pool

        public Pool(CharacterType ctype, PoolType ptype) {
            switch (ptype) {
                case PoolType.AttackEffectPool:
                    switch (ctype)
                    {
                        case CharacterType.PikeMan:
                            m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/pike_effect");
                            break;
                        case CharacterType.GunGirl:
                            m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/gungirl_effect");
                            break;
                        case CharacterType.SpiderQueen:
                            m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/SpiderQueen_effect");
                            break;
                        case CharacterType.Zako:
                            m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/Zako_effect");
                            break;
                        case CharacterType.ZakoFar:
                            m_pref = (GameObject)Resources.Load("Prefab/AttackEffect/syuriken");
                            break;
                    }
                    break;
                case PoolType.HitEffectPool:
                    break;
            }

            
        }
开发者ID:qq282196521,项目名称:DK,代码行数:28,代码来源:Pool.cs

示例12: InstantiateCharacterTypeInScene

	private void InstantiateCharacterTypeInScene(CharacterType characterType) {
		Character characterPrefab = GetCharacter(characterType);
		Character character = Instantiate(characterPrefab);
		character.transform.parent = characterHolder;
		character.transform.localPosition = Vector3.zero;
		currentCharacter = character;
	}
开发者ID:wtrebella,项目名称:Grappler,代码行数:7,代码来源:CharacterSelectManager.cs

示例13: Player

 protected Player(string name, int str, int dex, int vit, int intl, int strengthModifier, int dexterityModifier,
                  int vitalityModifier, int intelligenceModifier,
                  List<IItem> baseItems, CharacterType characterType)
     : base(name)
 {
     this.Strength = str;
     this.Dexterity = dex;
     this.Vitality = vit;
     this.Intelligence = intl;
     this.StrengthModifier = strengthModifier;
     this.DexterityModifier = dexterityModifier;
     this.VitalityModifier = vitalityModifier;
     this.IntelligenceModifier = intelligenceModifier;
     Position = new Position();
     this.Level = 1;
     this.Cash = 500;
     this.Inventory = new List<IItem>();
     this.Equiped = new List<IItem>();
     this.InitialItemEquip(baseItems);
     //CalculateAttackPoints();
     //CalculateDefencePoints();
     this.CalculateHitPoints();
     CurrentHitPoints = this.MaxHitPoints;
     this.CharacterType = characterType;
 }
开发者ID:ivnikolov,项目名称:RPG-Teamwork,代码行数:25,代码来源:Player.cs

示例14: CreateCharacter

        public static Character CreateCharacter(CharacterType newCharacterType, Vector2 position, Tile CurrentTile)
        {
            Character newCharacter = null;

            switch (newCharacterType)
            {
                case CharacterType.GRU:
                    newCharacter = CreateGru(position, CurrentTile);
                    break;

                case CharacterType.MINION_BANANA:
                    newCharacter = CreateBananaMinion(position, CurrentTile);
                    break;

                case CharacterType.POWERUP_MINION:
                    newCharacter = CreatePowerupMinion(position, CurrentTile);
                    break;

                case CharacterType.POLICE_OFFICER:
                    newCharacter = CreatePoliceOfficer(position, CurrentTile);
                    break;
            }

            return newCharacter;
        }
开发者ID:keylax,项目名称:TP2-Prog-DespicableGame,代码行数:25,代码来源:CharacterFactory.cs

示例15: GetAttackEffectPoolByType

 public static Pool GetAttackEffectPoolByType(CharacterType ctype) {
     if (!AEPoolDic.ContainsKey(ctype)) {
         Pool aePool = new Pool(ctype, Pool.PoolType.AttackEffectPool);
         AEPoolDic.Add(ctype, aePool);
         return aePool;
     }
     return AEPoolDic[ctype];
 }
开发者ID:qq282196521,项目名称:DK,代码行数:8,代码来源:CharacterContollerUtility.cs


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