本文整理汇总了C#中PlayerCharacter类的典型用法代码示例。如果您正苦于以下问题:C# PlayerCharacter类的具体用法?C# PlayerCharacter怎么用?C# PlayerCharacter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerCharacter类属于命名空间,在下文中一共展示了PlayerCharacter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
_playerSpawnPointPos = new Vector3 (0.0f, 0.057f, -136.9f);
GameObject go = GameObject.Find (GameSettings.PLAYER_SPAWN_POINT) as GameObject;
if (go == null) {
Debug.LogWarning ("Couldn't find Player Spawn Point. Did you forget to add it, mate?");
go = new GameObject (GameSettings.PLAYER_SPAWN_POINT);
Debug.Log ("Created Player Spawn Point");
go.transform.position = _playerSpawnPointPos;
Debug.Log ("Moved Player Spawn Point");
}
_player = Instantiate (playerCharacter, go.transform.position, Quaternion.identity) as GameObject;
_player.name = "Player";
_playerScript = _player.GetComponent<PlayerCharacter> ();
// mainCamera.transform.position = new Vector3 (_player.transform.position.x, _player.transform.position.y + yOffset, _player.transform.position.z + zOffset);
// mainCamera.transform.Rotate (xRotOffset, 0, 0);
LoadCharacter ();
_isLoadComplete = true;
}
示例2: Fire
public override void Fire(PlayerCharacter character)
{
if (Ammo <= 0)
{
Reload();
}
}
示例3: Main
static void Main()
{
var playerOne = new PlayerCharacter(new DiamondSkinDefense())
{
Name = "Jeremy"
};
var playerTwo = new PlayerCharacter(new IronBonesDefence()){
Name = "Jac",
DateOfBirth = DateTime.Now,
DaysSinceLastLogin = 5,
Health = 100,
IsNoob = true
};
var playerThree = new PlayerCharacter(SpecialDefense.Null)
{
Name = "John"
};
playerOne.Hit(10);
playerTwo.Hit(10);
playerThree.Hit(10);
PlayerDisplayer.Write(playerOne);
PlayerDisplayer.Write(playerTwo);
PlayerDisplayer.Write(playerThree);
}
示例4: ShouldHaveDeafultName2
public void ShouldHaveDeafultName2()
{
PlayerCharacter test = new PlayerCharacter();
var actualResult = test.Name;
Assert.True(!string.IsNullOrEmpty(actualResult));
}
示例5: handleHarvest
private void handleHarvest(PlayerCharacter pc, IncommingMessage msg)
{
if (pc.LoginState == PlayerCharacterLoginState.LoginSuccesfull)
{
HarvestIncommingMessage msgHarvest = (HarvestIncommingMessage)msg;
switch (pc.LocationCurrentMap.Name)
{
case ("calindor_startmap.elm"):
{
switch (msgHarvest.TargetObjectID)
{
case(138):
case (139):
{
ActionDescriptor actDesc = new HarvestActionDescriptor(2000, 1000);
actDesc.AddExperienceDescriptor(new ExperienceDescriptor(EntitySkillType.HarvestingPlants, 3, 15));
HarvestableResourceDescriptor rscDef =
new HarvestableResourceDescriptor(
ItemDefinitionCache.GetItemDefinitionByID(2), actDesc , 1);
pc.HarvestStart(rscDef);
break;
}
case (274):
{
ActionDescriptor actDesc = new HarvestActionDescriptor(3000, 1000);
actDesc.AddExperienceDescriptor(new ExperienceDescriptor(EntitySkillType.HarvestingPlants, 10, 25));
HarvestableResourceDescriptor rscDef =
new HarvestableResourceDescriptor(
ItemDefinitionCache.GetItemDefinitionByID(3), actDesc, 1);
pc.HarvestStart(rscDef);
break;
}
case (194):
{
ActionDescriptor actDesc = new HarvestActionDescriptor(3000, 1000);
actDesc.AddExperienceDescriptor(new ExperienceDescriptor(EntitySkillType.HarvestingPlants, 10, 25));
HarvestableResourceDescriptor rscDef =
new HarvestableResourceDescriptor(
ItemDefinitionCache.GetItemDefinitionByID(3), actDesc, 2);
pc.HarvestStart(rscDef);
break;
}
case (276):
{
ActionDescriptor actDesc = new HarvestActionDescriptor(3000, 1000);
actDesc.AddExperienceDescriptor(new ExperienceDescriptor(EntitySkillType.HarvestingPlants, 8, 20));
HarvestableResourceDescriptor rscDef =
new HarvestableResourceDescriptor(
ItemDefinitionCache.GetItemDefinitionByID(7), actDesc, 1);
pc.HarvestStart(rscDef);
break;
}
}
break;
}
}
}
}
示例6: PlayerState
public PlayerState( PlayerStateMachine stateMachine, PlayerCharacter character, PlayerController controller )
{
this.stateMachine = stateMachine;
this.controller = controller;
this.character = character;
Actions = character.Input.Actions;
}
示例7: ShouldNoHaveNickName
public void ShouldNoHaveNickName()
{
PlayerCharacter test = new PlayerCharacter();
var actualResult = test.NickName;
Assert.Null(actualResult);
}
示例8: Start
// Use this for initialization
void Start()
{
GameObject go = GameObject.Find(GameSettings.PLAYER_SPAWN_POINT); // player spawn point gameobject
_playerSpawnPointPos = new Vector3(1285, 5, 1666); // default position for player spawn point
if (go == null) // check if go isn't null
{
Debug.LogWarning("Cannot find player spawn point");
go = new GameObject(GameSettings.PLAYER_SPAWN_POINT);
go.transform.position = _playerSpawnPointPos;
Debug.Log("Created player spawn point");
}
_pc = Instantiate(playerCharacter, go.transform.position, Quaternion.identity) as GameObject;
_pc.name = "pc";
_pcScript = _pc.GetComponent<PlayerCharacter>();
// Get camera to be behind player char
zOffset = -2.5f;
yOffset = 2.5f;
xRotOffset = 22.5f;
mainCamera.transform.position = new Vector3(_pc.transform.position.x,
_pc.transform.position.y + yOffset,
_pc.transform.position.z + zOffset);
mainCamera.transform.Rotate(xRotOffset, 0, 0);
LoadCharacter();
}
示例9: ReferenceEqualityDemo
public void ReferenceEqualityDemo()
{
var player1 = new PlayerCharacter();
var player2 = new PlayerCharacter();
var somePlayer = player1;
Assert.That(somePlayer,Is.SameAs(player1));
}
示例10: ShouldGainHealthAfterSleeping
public void ShouldGainHealthAfterSleeping()
{
var playerCharacter = new PlayerCharacter();
playerCharacter.Sleep();
playerCharacter.HitPoints.ShouldBeGreaterThan(100);
playerCharacter.HitPoints.ShouldBeLessThanOrEqualTo(200);
}
示例11: Start
// Use this for initialization
void Start()
{
_playerSpawnPointPos = new Vector3(0,5,0); //The default position for our player spawn point
GameObject go = GameObject.Find(GameSettings.PLAYER_SPAWN_POINT);
if(go == null) {
// Debug.LogWarning("Can not find Player Spawn Point");
go = new GameObject(GameSettings.PLAYER_SPAWN_POINT);
// Debug.Log("Created Player Spawn Point");
go.transform.position = _playerSpawnPointPos;
// Debug.Log("Moved Player Spawn Point");
}
_pc = Instantiate(playerCharacter, go.transform.position, Quaternion.identity) as GameObject;
_pc.name = "pc";
_pcScript = _pc.GetComponent<PlayerCharacter>();
zOffset = -2.5f;
yOffset = 2.5f;
xRotOffset = 34.5f;
mainCamera.transform.position = new Vector3(_pc.transform.position.x, _pc.transform.position.y + yOffset, _pc.transform.position.z + zOffset);
mainCamera.transform.Rotate(xRotOffset, 0 , 0);
LoadCharacter();
}
示例12: ApplyEffect
public override PlayerCharacter ApplyEffect(PlayerCharacter pc)
{
switch (AbilityScoreToModify)
{
case enumAbilityScore.Strength:
pc.AbilityScore.Strength += Value;
break;
case enumAbilityScore.Dexterity:
pc.AbilityScore.Dexterity += Value;
break;
case enumAbilityScore.Constitution:
pc.AbilityScore.Constitution += Value;
break;
case enumAbilityScore.Intelligence:
pc.AbilityScore.Intelligence += Value;
break;
case enumAbilityScore.Wisdom:
pc.AbilityScore.Wisdom += Value;
break;
case enumAbilityScore.Charisma:
pc.AbilityScore.Charisma += Value;
break;
default:
break;
}
return pc;
}
示例13: Awake
void Awake()
{
_playerSpawnPointPos = new Vector3(1078,252,1055);
GameObject go = GameObject.Find(GameSettings.PLAYER_SPAWN_POINT);
if(go == null){
Debug.LogWarning("Can not find player spawn point.");
go = new GameObject(GameSettings.PLAYER_SPAWN_POINT);
Debug.Log("Created player spawn point.");
go.transform.position = _playerSpawnPointPos;
}
_pc = Instantiate(playerCharacter, go.transform.position, Quaternion.identity) as GameObject;
_pc.name = "pc";
_pcScript = _pc.GetComponent<PlayerCharacter>();
zOffset = -2.5f;
yOffset = 2.5f;
xRotOffset = 22.5f;
// mainCamera.transform.position = new Vector3(_pc.transform.position.x,_pc.transform.position.y +yOffset,_pc.transform.position.z +zOffset);
// mainCamera.transform.Rotate(xRotOffset, 0, 0);
//LoadCharacter();
}
示例14: Start
private Vector3 _playerSpawnPointPos; // this is the position of the player's spawn point
// Use this for initialization
void Start () {
_playerSpawnPointPos = new Vector3(96, 9, 47); // position of spawn point
GameObject go = GameObject.Find(GameSettings.PLAYER_SPAWN_POINT);
if(go == null ){
Debug.LogWarning("Cant find Player's Spawn");
go = new GameObject(GameSettings.PLAYER_SPAWN_POINT);
Debug.Log(" Created Spawn Point");
go.transform.position = _playerSpawnPointPos;
Debug.Log("Moved the Spawn Point");
}
_pc = Instantiate(playerCharacter, go.transform.position, Quaternion.identity)as GameObject;
_pc.name = "pc";
_pcScript = _pc.GetComponent<PlayerCharacter>();
zOffset = -0.58f;
yOffset = 0.3f;
xOffset = -0.03f;
xRotOffset = 21.45f;
yRotOffset = 0.94f;
zRotOffset = 0.38f;
mainCamara.transform.position = new Vector3(_pc.transform.position.x + xOffset, _pc.transform.position.y +yOffset,_pc.transform.position.z + zOffset);
mainCamara.transform.Rotate(xRotOffset, yRotOffset, zRotOffset);
LoadCharacter();
}
示例15: Start
// Use this for initialization
void Start()
{
_playerSpawnPointPos = new Vector3(3,-20,0); //the default position for our player spawn point
GameObject go = GameObject.Find(GameSettings.PLAYER_POSITION);
if(go == null) {
go = new GameObject(GameSettings.PLAYER_POSITION);
go.transform.position = GameSettings.LoadPlayerPosition();
//go.transform.position = _playerSpawnPointPos;
}
_pc = Instantiate(playerCharacter, go.transform.position, Quaternion.identity) as GameObject;
_pc.name = "pc";
_pcScript = _pc.GetComponent<PlayerCharacter>();
zOffset = -2.5f;
yOffset = 2.5f;
xRotOffset = 22.5f;
mainCamera.transform.position = new Vector3(_pc.transform.position.x, _pc.transform.position.y + yOffset, _pc.transform.position.z + zOffset);
mainCamera.transform.Rotate(xRotOffset, 0, 0);
LoadCharacter();
}