本文整理汇总了C#中Character类的典型用法代码示例。如果您正苦于以下问题:C# Character类的具体用法?C# Character怎么用?C# Character使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Character类属于命名空间,在下文中一共展示了Character类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: LoadCharacterListFromDisk
public void LoadCharacterListFromDisk()
{
// Full backup of current saves.
// Backup();
var cDirectory = Path.Combine(settings.Game.GameDataPath, "Saves");
if (!Directory.Exists(cDirectory))
{
Directory.CreateDirectory(cDirectory);
}
var saves = Directory.GetFiles(cDirectory, "*.ess");
foreach (var item in saves)
{
string file = Path.GetFileName(item);
string cName = GetCharacterName(item);
// Search for it in the collection
Character c = Characters.SingleOrDefault(x => x.Name.Equals(cName, StringComparison.OrdinalIgnoreCase));
if (c == null)
{
c = new Character(cName);
Characters.Add(c);
}
if (file != null && !c.Saves.Any(x => x.EndsWith(file, StringComparison.OrdinalIgnoreCase)))
{
c.Saves.Add(item);
}
}
}
开发者ID:Genesis2001,项目名称:Skyrim-Manager,代码行数:31,代码来源:CharacterManagerViewModel.cs
示例17: CharacterMonitor
/// <summary>
/// Initializes a new instance of the <see cref="CharacterMonitor"/> class.
/// </summary>
/// <param name="character">The character.</param>
public CharacterMonitor(Character character)
: this()
{
Header.SetCharacter(character);
Body.SetCharacter(character);
Footer.SetCharacter(character);
}
开发者ID:RapidFiring,项目名称:evemon,代码行数:11,代码来源:CharacterMonitor.cs
示例18: Clear
public static void Clear()
{
characters = new Dictionary<string, float>();
allCharacters = new Dictionary<string, Character>();
charSuspicion = new Dictionary<Character, float>();
accusedCharacter = null;
}
开发者ID:RollForReflex,项目名称:YouDunnit--Prototype,代码行数:7,代码来源:MansionResults.cs
示例19: AIRayCast
protected Character AIRayCast (Character targetCharacter){
SorcererAI ai = gameObject.GetComponent<SorcererAI> ();
if (ai != null && ai.enabled == true) {
return ai.checkNearestEnemy();
}
return targetCharacter;
}
开发者ID:marouen-lamiri,项目名称:Second-Soul,代码行数:7,代码来源:TargetedRangedSkill.cs
示例20: showSkill30AAttackEft
public void showSkill30AAttackEft(Character c)
{
if(c is Caiera)
{
Caiera caiera = c as Caiera;
caiera.showSkill30AAttackEftCallback -= showSkill30AAttackEft;
}
else if(c is Ch3_Caiera)
{
Ch3_Caiera caiera = c as Ch3_Caiera;
caiera.showSkill30AAttackEftCallback -= showSkill30AAttackEft;
}
int x = 0;
int lsx = 0;
if(c.model.transform.localScale.x > 0)
{
x = -54;
lsx = 4;
}
else
{
x = -54;
lsx = -4;
}
GameObject attackEft = null;
StaticData.createObjFromPrb(ref attackEftPrb, "eft/Caiera/Skill_CAIERA30A_AttackEft", ref attackEft, c.transform, new Vector3(x, 256, 0), new Vector3(lsx, 4, 1));
}
开发者ID:rogeryuan99,项目名称:Hello,代码行数:29,代码来源:Skill_CAIERA30A.cs
注:本文中的Character类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论