本文整理汇总了C#中PlayerController类的典型用法代码示例。如果您正苦于以下问题:C# PlayerController类的具体用法?C# PlayerController怎么用?C# PlayerController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerController类属于命名空间,在下文中一共展示了PlayerController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
//called before start: get references
private void Awake ()
{
explosion = (GameObject)Resources.Load("Explosion");
self = GetComponent<Transform>();
target = GameObject.Find("Application").GetComponent<Transform>();
playerController = GameObject.Find("Player").GetComponent<PlayerController>();
}
示例2: Start
// Use this for initialization
void Start()
{
//Get PlayerController Object that already exists in the scene
player = FindObjectOfType<PlayerController>();
//Get CameraController Object that already exists in the scene
camera = FindObjectOfType<CameraController>();
}
示例3: Start
protected override void Start()
{
base.Start ();
controller = GetComponent<PlayerController> ();
gunController = GetComponent<GunController> ();
viewCamera = Camera.main;
}
示例4: Start
void Start()
{
state = Enemy3State.Idle;
transform.localScale = new Vector3(1,1,1);
player = GameObject.FindGameObjectWithTag("Player");
playerController = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
}
示例5: OnUpdate
/*
* Called each frame that this effector is applied to the input player
*/
public virtual void OnUpdate(PlayerController player)
{
elapsedTime = Time.time - appliedTime;
if(lifeTime > 0.0f && elapsedTime >= lifeTime) {
bActive = false;
}
}
示例6: FindPlayersInRange
private void FindPlayersInRange()
{
HashSet<PlayerController> playersInRange = new HashSet<PlayerController>();
foreach (var player in PlayerController.GetAllPlayers())
{
if (Vector3.Distance(transform.position, player.transform.position) <= 18)
{
playersInRange.Add(player);
}
}
// add players that have entered
foreach (var player in playersInRange)
{
if (!_playersBeingHealed.ContainsKey(player))
{
_playersBeingHealed.Add(player, 0f);
}
}
// remove players that have left
PlayerController[] keys = new PlayerController[_playersBeingHealed.Keys.Count];
_playersBeingHealed.Keys.CopyTo(keys, 0);
foreach (var player in keys)
{
if (!playersInRange.Contains(player))
{
_playersBeingHealed.Remove(player);
}
}
}
示例7: Start
void Start()
{
st = transform.root.GetComponent<Storage>();
pc = GameObject.Find("Player").GetComponent<PlayerController>();
startPos = transform.position;
startScale = transform.localScale;
}
示例8: Initialize
// Use this for initialization
public void Initialize (PlayerController playerController) {
// Store main player component reference
this.mainPlayerController = playerController;
// Set initial avatar
this.ChangePlayerAvatar(this.mainPlayerController.Type);
}
示例9: Start
// Use this for initialization
void Start () {
InAir = false;
playerObject = GameObject.FindGameObjectWithTag("Player");
playerController = playerObject.GetComponent<PlayerController>();
canPlayerControl = true;
fTeleHeight = 1.0f;
onRelocationTile = false;
vPlayerOrigin = PlayerObj.transform.position;
fMandelaHeight = vPlayerOrigin.y + 10;
canTeleport = false;
canActivateTele = true;
if (isAttached)
{
canTeleport = true;
}
fLerpingValue = 0.0f;
fRotationSpeed = 4.0f;
nState = 0;
mandalaMovementController = transform.GetComponentInParent<MandalaMovementController>();
}
示例10: BreakoutPaddle
public BreakoutPaddle(Game game, string spriteName, PlayerController controller, BreakoutBall ball, float speed = 0f, float acceleration = 0f, float friction = 0f)
: base(game, spriteName, controller, speed, acceleration, friction)
{
this.lockedY = true;
this.ball = ball;
this.disabled = false;
}
示例11: Start
protected override void Start()
{
base.Start();
pc = GetComponent<PlayerController>();
gc = GetComponent<GunController>();
cam = Camera.main;
}
示例12: Start
// Use this for initialization
void Start()
{
pos = transform.position;
pcAccessor = GameObject.Find ("PlayerRobot").GetComponent<PlayerController>();
anim = GameObject.Find ("PlayerRobot").GetComponent<Animator>();
//pos.z = transform.position.z
}
示例13: OnGUI
void OnGUI () {
//make sure that your time is based on when this script was first called
//instead of when your game started
float guiTime = Time.time - startTime;
restSeconds = countDownSeconds - (guiTime);
//display messages or whatever here, do stuff based on your timer
if (restSeconds == 60) {
print ("One Minute Left");
}
if (restSeconds <= 0)
{
Debug.Log("Time is Over");
playerController = gameObject.GetComponent<PlayerController>();
playerController.ChangePlayer();
countDownSeconds = 10;
Awake();
}
//display the timer
roundedRestSeconds = Mathf.CeilToInt(restSeconds);
displaySeconds = roundedRestSeconds % 60;
displayMinutes = roundedRestSeconds / 60;
string text = string.Format("{0:00}:{1:00}", displayMinutes, displaySeconds);
GUI.Label (new Rect(400, 25, 100, 30), text);
}
示例14: Start
// Use this for initialization
void Start()
{
animator = GetComponent<Animator>();
currentIdleType = 1;
playerController = GameObject.Find(transform.parent.name + "/Pilot").GetComponent<PlayerController>();
rigidbody = GetComponent<Rigidbody2D> ();
}
示例15: Start
void Start()
{
playerEntity = GameObject.FindWithTag ("Player").GetComponent<Entity>();
playerController = GameObject.FindWithTag("Player").GetComponent<PlayerController>();
entity = gameObject.GetComponent<Entity>();
entity.currentBox.GetComponent<Box>().enemies.Add(gameObject);
}