本文整理汇总了C#中Human类的典型用法代码示例。如果您正苦于以下问题:C# Human类的具体用法?C# Human怎么用?C# Human使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Human类属于命名空间,在下文中一共展示了Human类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Human cason = new Human();
Human justin = new Human();
justin.MaxRunningSpeed = 20;
cason.Age = 27;
cason.EducationLevel = "Yes, pleaase";
cason.IsAlive = true;
bool wasAbleToRun = cason.Run(12);
if (wasAbleToRun)
{
Console.WriteLine("Yeah, go Cason!!");
}
else
{
Console.WriteLine("You can't run, Cason!!");
}
wasAbleToRun = justin.Run(12);
if (wasAbleToRun)
{
Console.WriteLine("Yeah, go Justin!!");
}
else
{
Console.WriteLine("You can't run, Jusin!!");
}
Console.WriteLine($"Age = {cason.Age}, IsAlive = {cason.IsAlive}");
}
示例2: Main
static void Main(string[] args)
{
Console.Title = "RepoProject Test Program";
List<Animal> animals = new List<Animal>();
Human sawyer = new Human();
sawyer.Age = 35;
sawyer.Gender = "Male";
sawyer.Name = "Groda Lotsapot";
Dog scooby = new Dog();
scooby.Age = 3;
scooby.Gender = "Male";
scooby.Name = "Scooby";
animals.Add(sawyer);
animals.Add(scooby);
foreach (Animal item in animals)
{
Console.WriteLine("Please meet " + item.Name + ". They are " + item.Age + " years old.");
if (item.GetType() == typeof(Dog))
{
Dog d = (Dog)item;
Console.WriteLine("That's " + d.DogYears + " in dogyears!");
}
}
Console.ReadKey();
}
示例3: Start
private void Start()
{
if (Guard._player == null)
Guard._player = GameObject.FindGameObjectWithTag("Player").transform;
if (Guard._playerr == null)
Guard._playerr = Guard._player.GetComponent<Rigidbody>();
if (Camera == null) Camera = Camera.main;
_human = GetComponent<Human>();
_human.IdleLook = () =>
{
if (Hack == null)
{
if (Physics.Raycast(Camera.ScreenPointToRay(Input.mousePosition), out _hit))
{
var m = _hit.point + transform.right * 0.25f;
m.y = transform.position.y;
transform.LookAt(m); // TODO lerp
}
}
};
_human.Forward = Camera.transform.forward;
_human.Forward.y = 0;
_human.Right = Camera.transform.right;
_human.Right.y = 0;
_switches = GameObject.FindGameObjectsWithTag("Switch");
GetComponent<AudioSource>().PlayOneShot(TeleClip, 0.8f);
}
示例4: CheckSurrounding
public void CheckSurrounding(Human LeMe, List<Human> HumansInSight)
{
if (LeMe.Victim.HumanType == HumanType.Dead)
{
LeMe.DecisionBehaviour = new UsualDecisionBehaviour();
LeMe.MovementBehaviour = new UsualMovementBehaviour();
LeMe.HumanType = HumanType.Normal;
}
foreach(Human h in HumansInSight)
{
if (h.HumanType != HumanType.Dead)
{
continue;
}
if (!((LeMe.Position - h.Position).Length() < 70.0f))
{
continue;
}
LeMe.Node = h.Position;
LeMe.MovementBehaviour = new EvadeMovementBehaviour();
}
}
示例5: HumanDeathCloud
public HumanDeathCloud(Human human)
: base(human.entityArea)
{
this.human = human;
this.x = human.x;
this.y = human.y+4;
frames = new FAtlasElement[]
{
Futile.atlasManager.GetElementWithName("Arena/Vill_Death1"),
Futile.atlasManager.GetElementWithName("Arena/Vill_Death2"),
Futile.atlasManager.GetElementWithName("Arena/Vill_Death3"),
Futile.atlasManager.GetElementWithName("Arena/Vill_Death4")
};
cloudHolder = new FContainer();
cloudSprite = new FSprite(frames[0]);
cloudSprite.scaleX = RXRandom.Bool() ? -1f : 1f;
cloudHolder.AddChild(cloudSprite);
cloudSprite.shader = FShader.Additive;
cloudSprite.alpha = RXRandom.Range(0.8f,0.9f);
cloudSprite.color = human.player.player.color.color + new Color(0.1f,0.1f,0.1f,0.0f);
cloudSprite.scale = 2.0f;
graveHolder = new FContainer();
graveSprite = new FSprite("Arena/Human_Grave_1");
graveHolder.AddChild(graveSprite);
graveSprite.color = human.player.player.color.color + new Color(0.5f,0.5f,0.5f);
graveSprite.y = 16;
Update();
}
示例6: Start
// Use this for initialization
void Start()
{
thisHuman = this.GetComponent<Human>();
GameController.player = this;
inventory = new string[7];
inventory[0] = "";
inventory[1] = "";
inventory[2] = "";
inventory[3] = "";
inventory[4] = "";
inventory[5] = "";
inventory[6] = "";
int failTest = 1000;
while(failTest > 0){
failTest--;
Town selectedTown = TerrainController.townList[Random.Range(0, TerrainController.townList.Count)];
if(selectedTown.HouseList.Count == 0){
continue;
}else{
Vector2 newPos = selectedTown.HouseList[Random.Range(0, selectedTown.HouseList.Count)];
this.transform.position = new Vector3(newPos.x, 0, newPos.y);
break;
}
}
}
示例7: CharacterManager
// Ctor & Methods //
public CharacterManager()
{
_human = new Human("Bobby");
_dog = new Dog("Billy");
SelectedCharacter = _human;
_enemies = new List<Enemy>();
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
_enemies.Add(new Enemy("Steve"));
}
示例8: PlacePersonHouse
/// <summary>
/// placing a person in a house if false is returned then cant find a spot or the person does not exsist
/// </summary>
/// <param name="thePerson"> The person to place</param>
/// <returns> if can be placed</returns>
public bool PlacePersonHouse(Human thePerson)
{
if (!thePerson) // if nothing is passed then cant find a point for them
{
Debug.Log("1");
return false;
}
for (int i = 0; i < peopleList.Length; i++)
{
if (peopleList[i] == thePerson)
{
return false;
}
}
int hold = NextEmptySlot();
if (hold<0) // if there are no empty slots return false
{
Debug.LogError("no empty slots" + thePerson.name + " " + name);
return false;
}
peopleList[hold] = thePerson;
thePerson.transform.position = peoplePoint[hold].position;
thePerson.shelterNum = shelterID;
return true;
}
示例9: Main
static void Main()
{
Human Kim = new Human("김상형", 25);
Kim.Intro();
Human Lee = new Human("이순신");
Lee.Intro();
}
示例10: MainFunction
private void MainFunction()
{
Debug.Log("Hello C Sharp");
int a = 3;
int []jackArray = new int[3];
jackArray[0] = 2;
jackArray[1] = 8;
jackArray[2] = 5;
int []maryArray = new int[]{7,8,9};
jackArray = maryArray;
maryArray[0] = 999;
int result = jackArray[0];
//Debug.Log("result : "+result);
Human h = new Human();
h.name = "Raiden";
Human g = new Human();
g.name = "Takisawa";
Human k = null;
k = h;
h = g;
Debug.Log(h.name);
}
示例11: Button_Click
private void Button_Click(object sender, RoutedEventArgs e)
{
Human h = new Human();
School.SetGrade(h, 6);
int grade = School.GetGrade(h);
MessageBox.Show(grade.ToString());
}
示例12: Main
public static void Main()
{
Console.WriteLine(Human.Planet);
Human man = new Human(17, "Ilya");
man.Print_Inf();
Human second_man = new Human(24, "Alex", city: "Minsk");
second_man.Print_Inf();
Console.WriteLine("In what city there lives the man? ");
man.City = Console.ReadLine();
Console.WriteLine("In what country there lives the second_man? ");
second_man.Country = Console.ReadLine();
Console.WriteLine("\nNew information: \n");
man.Print_Inf();
second_man.Print_Inf();
Console.WriteLine("Press any key to do nothing :)");
Console.Read();
Console.WriteLine();
man.do_something();
Console.WriteLine("");
Console.WriteLine("What can the man do? ");
man.do_something(Console.ReadLine());
}
示例13: Main
static void Main()
{
Human Lee = new Human();
Lee.Name = "이순신";
Lee.Age = 32;
Console.WriteLine("이름 : " + Lee.Name + ", 나이 : " + Lee.Age);
}
示例14: Move
public Vec2 Move(Human LeMe, IEnumerable<Human> NearestNeighbours)
{
if ((LeMe.Node - LeMe.Position).Length() > 100.0f)
{
LeMe.Node = this.GetNewTarget(LeMe);
if (LeMe.HumanType == HumanType.Agent)
{
LeMe.MovementBehaviour = new AgentMovementBehaviour();
}
else
{
LeMe.MovementBehaviour = new UsualMovementBehaviour();
}
}
this.velocity = LeMe.Node - LeMe.Position;
this.velocity.Mul(-1.0f);
this.velocity.Mul(1.0f / this.velocity.Length());
this.velocity.Mul(this.speed);
foreach (var human in NearestNeighbours.Where(Human => Human.Position != LeMe.Position && !(Human.HumanType != HumanType.Agent && LeMe.HumanType == HumanType.Victim)))
{
this.distance = human.Position - LeMe.Position;
var num = this.distance.Length();
distance.Mul(1.0f / distance.Length());
distance.Mul(1.7f);
if (!(num <= 15.0f))
{
continue;
}
num = 15.0f - num;
num /= 15.0f;
this.distance.Mul(num * -1f);
this.distance.Mul(3.5f);
this.velocity += this.distance;
this.distance = human.Position - LeMe.Position;
}
this.velocity.Mul(1.0f / this.velocity.Length());
this.velocity.Mul(this.speed);
LeMe.Position = LeMe.Position + this.velocity;
return LeMe.Position;
}
示例15: Main
static void Main()
{
Human human = new Human();
human.GetGenderById(9312051224);
Console.WriteLine(human);
}