當前位置: 首頁>>代碼示例>>C#>>正文


C# Character類代碼示例

本文整理匯總了C#中Character的典型用法代碼示例。如果您正苦於以下問題:C# Character類的具體用法?C# Character怎麽用?C# Character使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Character類屬於命名空間,在下文中一共展示了Character類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CharacterEnter

    override public void CharacterEnter(Character p) {
      if (p == null) return;

      base.CharacterEnter(p);
      p.EnterArea(Areas.Grabbable);
      p.grab = this;
    }
開發者ID:llafuente,項目名稱:unity-platformer,代碼行數:7,代碼來源:Grab.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     owner = GetComponentInParent<Character>();
     playerHit = Resources.Load<ParticleSystem>("Particles/Prefabs/OnHit/FX_BloodHit_Player");
     enemyHit = Resources.Load<ParticleSystem>("Particles/Prefabs/OnHit/FX_BloodHit_EnemySlow");
     envHit = Resources.Load<ParticleSystem>("Particles/Prefabs/OnHit/FX_EnvHit");
 }
開發者ID:wjSimon,項目名稱:GD1014_s3p,代碼行數:8,代碼來源:WeaponScript.cs

示例3: AddModifiers

        /// <summary>
        /// Add modifiers.
        /// </summary>
        /// <param name="stage">
        /// The stage during character update this is called.
        /// </param>
        /// <param name="addModifier">
        /// Add modifiers by calling this method.
        /// </param>
        /// <param name="character">
        /// The character to add modifiers for.
        /// </param>
        protected override void AddModifiers(CharacterUpdateStage stage, Action<Modifier> addModifier, Character character)
        {
            base.AddModifiers(stage, addModifier, character);

            addModifier(new Modifier(character[ScoreType.Speed], character[MovementMode], character[ScoreType.Speed].Total));
            addModifier(new Modifier(this, character[MovementMode], 0, string.Format("see {0}", Name)));
        }
開發者ID:anthonylangsworth,項目名稱:GammaWorldCharacter,代碼行數:19,代碼來源:AdditionalMovementMode.cs

示例4: CheckVolume

	private bool CheckVolume(Character target)
	{
		float min, max;
		min = size * minSizeLimit;
		max = size * maxSizeLimit;
		return min <= target.size && target.size < max;
	}
開發者ID:mysticfarer,項目名稱:ggj-color,代碼行數:7,代碼來源:Trap.cs

示例5: TestJsonSerialization

        public void TestJsonSerialization(Character character)
        {
            JsonCharacterSerializer characterSerializer;
            Character newCharacter;
            string json;

            characterSerializer = new JsonCharacterSerializer();
            json = characterSerializer.Serialize(character);
            newCharacter = characterSerializer.Deserialize(json);

            Assert.That(newCharacter, Is.EqualTo(character), "Characters differ");
            Assert.That(newCharacter.GetHeldItem<Item>(Hand.Main), Is.EqualTo(character.GetHeldItem<Item>(Hand.Main)),
                "Main hands differ");
            Assert.That(newCharacter.GetHeldItem<Item>(Hand.Off), Is.EqualTo(character.GetHeldItem<Item>(Hand.Off)),
                "Main hands differ");
            Assert.That(
                Array.ConvertAll((Slot[])Enum.GetValues(typeof(Slot)), x => newCharacter.GetEquippedItem<Item>(x)),
                Is.EquivalentTo(Array.ConvertAll((Slot[])Enum.GetValues(typeof(Slot)), character.GetEquippedItem<Item>)),
                "Equipped items differ");
            Assert.That(
                newCharacter.Gear.OrderBy(x => x.Name),
                Is.EquivalentTo(character.Gear.OrderBy(x => x.Name)),
                "Carried items differ");
            Assert.That(
                newCharacter.Levels.OrderBy(x => x.Number),
                Is.EquivalentTo(character.Levels.OrderBy(x => x.Number)),
                "Levels differ");
        }
開發者ID:anthonylangsworth,項目名稱:GammaWorldCharacter,代碼行數:28,代碼來源:TestSerialization.cs

示例6: Use

 public void Use(UseActionEnum actionEnum, Character.MyCharacter user)
 {
     switch(actionEnum)
     {
         case UseActionEnum.Manipulate:
             if (!m_buttonPanel.IsWorking)
                 return;
             if (!m_buttonPanel.AnyoneCanUse && !m_buttonPanel.HasLocalPlayerAccess())
             {
                 MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                 return;
             }
             m_buttonPanel.Toolbar.UpdateItem(m_index);
             m_buttonPanel.Toolbar.ActivateItemAtIndex(m_index);
             m_buttonPanel.PressButton(m_index);
             break;
         case UseActionEnum.OpenTerminal:
             if (!m_buttonPanel.HasLocalPlayerAccess())
                 return;
             MyToolbarComponent.CurrentToolbar = m_buttonPanel.Toolbar;
             MyGuiScreenBase screen = MyGuiScreenCubeBuilder.Static;
             if (screen == null)
                 screen = MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.ToolbarConfigScreen, 0, m_buttonPanel);
             MyToolbarComponent.AutoUpdate = false;
             screen.Closed += (source) => MyToolbarComponent.AutoUpdate = true;
             MyGuiSandbox.AddScreen(screen);
             break;
         default:
             break;
     }
 }
開發者ID:leandro1129,項目名稱:SpaceEngineers,代碼行數:31,代碼來源:MyUseObjectPanelButton.cs

示例7: Shoot

//	public void FireMulti(Character target){
//		curTarget = target;
//		Transform house = transform.GetChild (0);
//		house.gameObject.GetComponent<Renderer>().sortingOrder = 4;
//		foreach(Character chara in EnemySpawnManager._instance.enemyList){
//			if(Vector3.Distance(chara.GetPos(),curTarget.GetPos()) <= explosionRange){
//				curTargetList.Add(chara);
//			}
//		}
//		distanceToTarget = Vector3.Distance (this.transform.position, target.GetPos());
//		StartCoroutine (Shoot (target));
//	}

	IEnumerator Shoot(Character target){
		while (move) {
			if(target != null){
				Vector3 targetPos = target.GetPos();
				this.transform.LookAt(targetPos);
				float currentDist = Vector3.Distance(this.transform.position, target.GetPos());
				if(currentDist < minDistance){
					move = false;
					if(node.GetPosion && isAntennaFire == false){
						OnDOTEffect();
					}
					OnHited();
				}
				this.transform.Translate(Vector3.forward*Mathf.Min(speed * Time.deltaTime,currentDist));
				yield return null;
			}
			else{
				move = false;
				if(parent1 != null){
					parent1 = null;
					BulletPool.instance.Push(this.gameObject);
				}
				else if(antennaParent != null){
					antennaParent = null;
					AtennaEffectPool.instance.Push(this.gameObject);
				}
				else 
					Destroy(this.gameObject);
			}
		}
	}
開發者ID:ziyihu,項目名稱:Tower-Defence,代碼行數:44,代碼來源:CannonBullet.cs

示例8: Create

     public static Character Create(int level)
     {
         var toReturn = new Character();
         //todo set stats from an algorithm here.

        return toReturn;
     }
開發者ID:devgr,項目名稱:NashGameCode,代碼行數:7,代碼來源:Character.cs

示例9: AfterBinderRetraction

        public void AfterBinderRetraction()
        {
            Character theDuke = new Character("The Duke", "hello world");
            Hashtable bo = new Hashtable();
            bo.Add("THEDUKE", theDuke);

            // first test to confirm that a pre-existing fact is not rededucted
            IInferenceEngine ie = new IEImpl(new FlowEngineBinder(ruleFilesFolder + "testbinder3.ruleml.xbre",
                                                                  BindingTypes.BeforeAfter));

            ie.LoadRuleBase(new RuleML09NafDatalogAdapter(ruleFilesFolder + "testbinder.ruleml",
                                                       		FileAccess.Read));

            ie.Assert(new Fact("retract_target", "education", new Individual(theDuke), new Individual("polite")));
            ie.NewFactHandler += new NewFactEvent(ShowAllNewFacts);
            deducted = 0;
            ie.Process(bo);
            Assert.AreEqual(0, deducted, "The Duke was already polite!");

            // second test to confirm that retracting the fact in the after binder restarts inference
            ie = new IEImpl(new FlowEngineBinder(ruleFilesFolder + "testbinder4.ruleml.xbre",
                                   							 BindingTypes.BeforeAfter));

            ie.LoadRuleBase(new RuleML09NafDatalogAdapter(ruleFilesFolder + "testbinder.ruleml", FileAccess.Read));

            ie.Assert(new Fact("retract_target", "education", new Individual(theDuke), new Individual("polite")));
            ie.NewFactHandler += new NewFactEvent(ShowAllNewFacts);
            deducted = 0;
            ie.Process(bo);
            Assert.AreEqual(1, deducted, "The Duke was re-deducted polite!");
        }
開發者ID:Ghasan,項目名稱:NxBRE,代碼行數:31,代碼來源:TestBinder.cs

示例10: RogueRotationCalculatorCombat

        public RogueRotationCalculatorCombat(Character character, Stats stats, BossOptions bossOpts, CalculationOptionsRogue calcOpts, float hasteBonus, float mainHandSpeed, float offHandSpeed, float mainHandSpeedNorm,
            float offHandSpeedNorm, float avoidedWhiteMHAttacks, float avoidedWhiteOHAttacks, float avoidedMHAttacks, float avoidedOHAttacks, float avoidedFinisherAttacks,
            float avoidedPoisonAttacks, float chanceExtraCPPerHit, RogueAbilityStats mainHandStats, RogueAbilityStats offHandStats, RogueAbilityStats mainGaucheStats,
            RogueAbilityStats sStrikeStats, RogueAbilityStats rStrikeStats, RogueAbilityStats ruptStats, RogueAbilityStats evisStats, RogueAbilityStats snDStats, RogueAbilityStats exposeStats,
            RogueAbilityStats iPStats, RogueAbilityStats dPStats, RogueAbilityStats wPStats) : base(character, stats, bossOpts, calcOpts, hasteBonus, mainHandSpeed, offHandSpeed, mainHandSpeedNorm,
            offHandSpeedNorm, avoidedWhiteMHAttacks, avoidedWhiteOHAttacks, avoidedMHAttacks, avoidedOHAttacks, avoidedFinisherAttacks, avoidedPoisonAttacks, chanceExtraCPPerHit, mainHandStats,
            offHandStats, ruptStats, snDStats, exposeStats, iPStats, dPStats, wPStats)
        {
            SStrikeStats = sStrikeStats;
            RStrikeStats = rStrikeStats;
            EvisStats = evisStats;
            MainGaucheStats = mainGaucheStats;

            ChanceOnMGAttackOnMHAttack = RV.Mastery.MainGauche + RV.Mastery.MainGauchePerMast * StatConversion.GetMasteryFromRating(stats.MasteryRating);
            EnergyRegenMultiplier = (1f + RV.Mastery.VitalityRegenMult) * (1f + (RV.AR.Duration + (Talents.GlyphOfAdrenalineRush ? RV.Glyph.ARDurationBonus : 0f)) / RV.AR.CD * Talents.AdrenalineRush) * (1f + HasteBonus) - 1f;

            #region Probability tables
            float c = ChanceExtraCPPerHit, h = (1f - c), f = CPOnFinisher, nf = (1f - f);
            _averageNormalCP[1] = 1 * (f + nf * h) + 2 * (nf * c);
            _averageNormalCP[2] = 2 * (f * h + nf * c + nf * h * h) + 3 * (f * c);
            _averageNormalCP[3] = 3 * (f * c + f * h * h + 2 * nf * c * h + nf * h * h * h) + 4 * (f * h * c + nf * c * c + nf * h * h * c);
            _averageNormalCP[4] = 4 * (2 * f * c * h + f * h * h * h + nf * c * c + 3 * nf * c * h * h + nf * h * h * h * h) + 5 * (f * c * c + f * h * h * c + 2 * nf * c * h * c + nf * h * h * h * c);
            _averageNormalCP[5] = 5 * (f * c * c + 3 * f * c * h * h + f * h * h * h * h + 3 * nf * c * c * h + 4 * nf * c * h * h * h + nf * h * h * h * h * h) + 6 * (2 * f * c * h * c + f * h * h * h * c + nf * c * c * c + 3 * nf * c * h * h * c + nf * h * h * h * h * c);

            c = ChanceExtraCPPerHit + ChanceOnCPOnSSCrit * SStrikeStats.CritChance; h = (1f - c);
            _averageSStrikeCP[1] = 1 * (f + nf * h) + 2 * (nf * c);
            _averageSStrikeCP[2] = 2 * (f * h + nf * c + nf * h * h) + 3 * (f * c + nf * h * c);
            _averageSStrikeCP[3] = 3 * (f * c + f * h * h + 2 * nf * c * h + nf * h * h * h) + 4 * (f * h * c + nf * c * c + nf * h * h * c);
            _averageSStrikeCP[4] = 4 * (2 * f * c * h + f * h * h * h + nf * c * c + 3 * nf * c * h * h + nf * h * h * h * h) + 5 * (f * c * c + f * h * h * c + 2 * nf * c * h * c + nf * h * h * h * c);
            _averageSStrikeCP[5] = 5 * (f * c * c + 3 * f * c * h * h + f * h * h * h * h + 3 * nf * c * c * h + 4 * nf * c * h * h * h + nf * h * h * h * h * h) + 6 * (2 * f * c * h * c + f * h * h * h * c + nf * c * c * c + 3 * nf * c * h * h * c + nf * h * h * h * h * c);
            #endregion
        }
開發者ID:LucasPeacecraft,項目名稱:rawr,代碼行數:32,代碼來源:RogueRotationCalculatorCombat.cs

示例11: IsAvaible

 public bool IsAvaible(Character character)
 {
     var rank = character.RanksTaken + 1;
     return MinRank <= rank
         && rank <= MaxRank
         && IsAvaibleCore(character);
 }
開發者ID:DrizztDoUrden,項目名稱:DarkHeresyScetches,代碼行數:7,代碼來源:LearningPackage.cs

示例12: showEft

    public void showEft(Character character)
    {
        Mantis mantis = character as Mantis;

        mantis.skill15BKeyFrameEventCallback -= showEft;
        if(skillEft_MANTIS15BPrb == null)
        {
            skillEft_MANTIS15BPrb = Resources.Load("eft/Mantis/SkillEft_MANTIS15B") as GameObject;
        }

        Destroy(skillEft_MANTIS15B);

        skillEft_MANTIS15B = Instantiate(skillEft_MANTIS15BPrb) as GameObject;

        float x = 0;
        if(mantis.model.transform.localScale.x > 0)
        {
            x = -34;
        }
        else
        {
            x = 34;
        }

        skillEft_MANTIS15B.transform.position = character.transform.position + new Vector3(x, 261, 0);
        skillEft_MANTIS15B.transform.localScale = new Vector3(0.164f, 0.164f, 1);

        StartCoroutine(showBullet(skillEft_MANTIS15B.transform.position));
    }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:29,代碼來源:Skill_MANTIS15B.cs

示例13: Use

 public override void Use(Level level, Character actor, Character target)
 {
     //Console.WriteLine("{0} is attacking {1} for {2} damage!", actor.Name, target.Name, actor.AttackDamage);
     var damage = (int)(actor.AttackDamage + level.rnd.Next(-2, 2));
     target.TakeDamage(damage);
     //actor.LastAction = string.Format("Attacked {0} for {1} damage!", target.Name, damage);
 }
開發者ID:xposure,項目名稱:Demo,代碼行數:7,代碼來源:AbilityAttack.cs

示例14: Play

	public void Play(Character target)
	{
#if	UNITY_3_0_0 || UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5
		gameObject.SetActiveRecursively(true);
#else
		gameObject.SetActive(true);
#endif
		// fire a missile
		Vector3 pos = transform.position + new Vector3(0f, startOffset, 0f);
		Vector3 targetPos = target.transform.position + target.targetingOffset;

		// want the missiles to go up a bit before turning to target, so calc a path for 'em
		Vector3[] path = new Vector3[3];
		float distance = Vector3.Distance(pos, targetPos);
		path[0] = pos;
		path[1] = Vector3.MoveTowards(pos, targetPos, distance / 2.3f);
		path[1].y += missileHeightGain;
		path[2] = targetPos;

		GameObject missileGameObject = (GameObject)GameObject.Instantiate(missileFab, pos, Quaternion.identity);
		iTween.MoveTo(missileGameObject, iTween.Hash(
				"speed", missileSpeed,
				"orienttopath", true,
				"path", path,
				"easetype", "linear",
				"oncomplete", "OnFXMissileReachedTarget",
				"oncompletetarget", gameObject,
				"oncompleteparams", missileGameObject
			));
	}
開發者ID:daren511,項目名稱:ThroneWarsServer,代碼行數:30,代碼來源:SampleWeapon.cs

示例15: CharacterStatsController

    public CharacterStatsController(Character character)
    {
        //_character = character;
        _sphereMaterial = character.PhysicsController.Capsule.GetComponent<MeshRenderer>().sharedMaterial;

        UpdateHealthColor();
    }
開發者ID:leorojas86,項目名稱:UnityBaseProject,代碼行數:7,代碼來源:CharacterStatsController.cs


注:本文中的Character類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。