本文整理汇总了C#中PlayerControl类的典型用法代码示例。如果您正苦于以下问题:C# PlayerControl类的具体用法?C# PlayerControl怎么用?C# PlayerControl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerControl类属于命名空间,在下文中一共展示了PlayerControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyStart
void MyStart()
{
myRigid2D = this.GetComponent<Rigidbody2D>();
GameObject player = GameObject.FindWithTag("Player");
playCon = player.GetComponent<PlayerControl>();
anim = this.GetComponent<Animator>();
}
示例2: Setup
public override void Setup(GameObject player) {
this.player = player;
playerControl = player.GetComponent<PlayerControl> ();
originalJump = playerControl.jumpSpeed;
originalMoveSpeed = playerControl.airControl;
activationStatus = player.GetComponent<PlayerNotification> ();
}
示例3: Awake
void Awake()
{
// Setting up the references.
anim = transform.root.gameObject.GetComponent<Animator>();
playerCtrl = transform.root.GetComponent<PlayerControl>();
rocket = rocketGO.rigidbody2D;
}
示例4: Start
// Use this for initialization
void Start()
{
player = GameObject.Find("Player");
playerScript = player.GetComponent<PlayerControl> ();
pickedUp = false;
//canThrow = true;
}
示例5: Start
// Use this for initialization
void Start()
{
gameMaster = Camera.main.GetComponent<GameMaster> ();
playerControl = Camera.main.GetComponent<PlayerControl> ();
stats = Camera.main.GetComponent<Statistics> ();
source = Camera.main.GetComponent<AudioSource> ();
}
示例6: StartSpeech
public void StartSpeech(GameObject initiator)
{
if (showingText)
{
return;
}
if (randomizeTexts)
{
textIndex = Random.Range(0, texts.Length - 1);
}
if (initiator.CompareTag(playerTag))
{
playerControl = initiator.GetComponent<PlayerControl>();
playerControl.freezeInput = true;
speech.SetActive(true);
showingText = true;
skipUpdate = true;
textAdvancer = initiator.GetComponent<TextAdvancer>();
DrawText();
}
}
示例7: Awake
private void Awake()
{
// Master
MasterView viewMaster = Instantiate( masterView );
viewMaster.Initialize( gameSetting.masterSetting );
Master master = new Master( viewMaster );
MasterAIControl masterControl = new MasterAIControl( master );
// AI
List<AIControl> AIControlList = new List<AIControl>();
List<Character> AICharacter = new List<Character>();
for ( int i = 0; i < AINumber; ++i )
{
CharacterView view = Instantiate( characterPrefab );
view.Initialize( gameSetting.characterSetting );
Character character = new Character( view );
AIControl aiControl = new AIControl( gameSetting.AIControlSetting, character, master );
AIControlList.Add( aiControl );
AICharacter.Add( character );
}
// Player
CharacterView playerView = Instantiate( characterPrefab );
playerView.Initialize( gameSetting.characterSetting );
Character player = new Character( playerView );
PlayerControl playerControl = new PlayerControl( player, AICharacter );
GameTime gameTime = new GameTime();
controllerManager = new ControllerManager(playerControl, AIControlList, masterControl);
gameManager = new GameManager( gameTime, controllerManager, player, AICharacter, master );
successPanel.SetGameTime( gameTime );
}
示例8: Start
void Start()
{
playerControl = GameObject.FindGameObjectWithTag(TagManager.PLAYER).GetComponent<PlayerControl>();
vomit = GameObject.FindGameObjectWithTag("Vomit").GetComponent<ParticleSystem>();
switcher = gameObject.GetComponent<CameraSwitcher>();
audio.clip = vomitSound;
}
示例9: Start
//private bool destroyed = false;
void Start(){
soundManager = gameObject.GetComponentInChildren<SoundManager>();
energy = maxEnergy;
score = FindObjectOfType(typeof(ScoreKeeper)) as ScoreKeeper;
playerControl = gameObject.GetComponentInChildren<PlayerControl>();
playerGUI = gameObject.GetComponentInChildren<PlayerGUI>();
playerHealth = gameObject.GetComponentInChildren<PlayerHealth>();
thrust = gameObject.GetComponentInChildren<Thrust>();
shield = gameObject.AddComponent<Shield>() as Shield;
shield.PDelegate = this;
foreach(Weapon weapon in gameObject.GetComponentsInChildren(typeof(IWeapon))){
if(weapon.gameObject.name == "Left weapon"){
leftWeapon = weapon;
leftWeapon.soundManager = soundManager;
}else if(weapon.gameObject.name == "Right weapon"){
rightWeapon = weapon;
rightWeapon.soundManager = soundManager;
}
}
StartCoroutine("RegenerateEnergy");
}
示例10: PlayerParty
public PlayerParty(PlayerControl control)
{
Members = new List<HumanCharacter>();
_playerControl = control;
}
示例11: Update
// Update is called once per frame
void Update()
{
if(player == null)
{
var players = FindObjectsOfType<PlayerControl>();
player = players.FirstOrDefault(x => (int)x.PlayerIndex == PlayerIndex);
}
if(player != null)
{
var damageable = player.GetComponent<Damageable>();
var health = Mathf.Clamp(damageable.Health / damageable.StartingHealth, 0, 1);
healthBar.localScale = new Vector3(health, 1, 1);
if(player.CurrentWeapon == null)
weaponLabel.text = "";
else
{
weaponLabel.text = player.CurrentWeapon.GetPickupName();
var ammo = player.CurrentWeapon.GetAmmoCount();
if(ammo > -1)
weaponLabel.text += " " + ammo;
}
score.text = GameState.Players[player.PlayerIndex].RoundScore.ToString();
}
}
示例12: Awake
void Awake()
{
// Setting the current health when the player first spawns.
currentHealth = startingHealth;
playerControlScript = GetComponent<PlayerControl> ();
godMode = false;
}
示例13: Awake
private PlayerControl playerCtrl; // Reference to the PlayerControl script.
#endregion Fields
#region Methods
void Awake()
{
// Setting up the references.
playerCtrl = transform.parent.GetComponent<PlayerControl>();
Rigidbody2D bulletInstance = Instantiate(ammo, transform.position, Quaternion.Euler(new Vector3(0,0,0))) as Rigidbody2D;
bulletInstance.velocity = new Vector2(speed, 0);
}
示例14: Update
// Update is called once per frame
public virtual void Update()
{
if (player == null)
{
player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();
}
}
示例15: Start
// Use this for initialization
void Start()
{
playerControl = Camera.main.GetComponent<PlayerControl> ();
source = Camera.main.GetComponent<AudioSource> ();
gameMaster = Camera.main.GetComponent<GameMaster> ();
timer = 45;
}