本文整理汇总了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;
}
示例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");
}
示例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)));
}
示例4: CheckVolume
private bool CheckVolume(Character target)
{
float min, max;
min = size * minSizeLimit;
max = size * maxSizeLimit;
return min <= target.size && target.size < max;
}
示例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");
}
示例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;
}
}
示例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);
}
}
}
示例8: Create
public static Character Create(int level)
{
var toReturn = new Character();
//todo set stats from an algorithm here.
return toReturn;
}
示例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!");
}
示例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
}
示例11: IsAvaible
public bool IsAvaible(Character character)
{
var rank = character.RanksTaken + 1;
return MinRank <= rank
&& rank <= MaxRank
&& IsAvaibleCore(character);
}
示例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));
}
示例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);
}
示例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
));
}
示例15: CharacterStatsController
public CharacterStatsController(Character character)
{
//_character = character;
_sphereMaterial = character.PhysicsController.Capsule.GetComponent<MeshRenderer>().sharedMaterial;
UpdateHealthColor();
}