本文整理汇总了C#中PlayerMovement类的典型用法代码示例。如果您正苦于以下问题:C# PlayerMovement类的具体用法?C# PlayerMovement怎么用?C# PlayerMovement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerMovement类属于命名空间,在下文中一共展示了PlayerMovement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
//public Collider2D meleeTrigger;
void Awake () {
rb = GetComponent<Rigidbody2D> ();
s_movement = GetComponent<PlayerMovement> ();
directionIndicator.transform.position = new Vector3(directionIndicator.transform.position.x, directionIndicator.transform.position.y + weaponHeightAboveCenter, directionIndicator.transform.position.z);
}
示例2: Awake
void Awake ()
{
onFire = false;
announcerAudio = GetComponents<AudioSource> () [1];
playerAttack = GetComponent<PlayerAttack> ();
canvas = GameObject.Find ("HUDCanvas");
//Debug.Log ("PlayerHealthUI_" + playerAttack.playerNum);
inGameHealthUI = canvas.GetComponent<RectTransform> ().Find ("PlayerHealthUI_" + playerAttack.playerNum)
.GetComponent<InGameHealthUI>();
inGameHealthUI.playerHealth = this;
rigid = GetComponent<Rigidbody> ();
gm = GameObject.Find ("GameManager").GetComponent<GameManager> ();
uim = GameObject.Find ("GameManager").GetComponent<UI_Manager> ();
joystickNum = playerAttack.joystickNum;
damageReduction = 1;
allgrounds = GameObject.FindGameObjectsWithTag("Island");
anim = GetComponent <Animation> ();
playerAudio = GetComponent <AudioSource> ();
playerMovement = GetComponent <PlayerMovement> ();
//playerShooting = GetComponentInChildren <PlayerShooting> ();
currentHealth = startingHealth;
SetupHealthUI ();
}
示例3: Awake
void Awake ()
{
// first get the playermovement and playerrotation on THIS script's gameobject
_playerMovement_ref = GetComponent<PlayerMovement> ();
_playerRotation_ref = GetComponent<PlayerRotation>();
// and the player
m_Player = GetComponent<Player>();
// then tell the inputcontrollermanager to set its static variables to match
// THIS script's _iControllerNumber,
InputControllerManager.KeyMap map = InputControllerManager.WhatControllerAmI(_iControllerNumber);
// THEN set THIS script's movement and rotation script axis values to match the inputcontroller's values
// [playermovement]
_playerMovement_ref._horizontalAxis = map._horizontalAxis;
_playerMovement_ref._verticalAxis = map._verticalAxis;
// [playerrotation]
_playerRotation_ref._horizontalAxis = map._horizontalAxis;
_playerRotation_ref._verticalAxis = map._verticalAxis;
m_Player.m_Attack = map._button01;
m_Player.m_Pause = map._buttonPause;
}
示例4: PlayerHit
//override = je maakt een extensie van die functie
public override void PlayerHit(PlayerMovement _GO)
{
base.PlayerHit(_GO);//roep de basis classe nog wel aan(dus de playerhit in pickup)
//voeg hier code toe zo dat de speler zijn score omhoog gaat
_GO.m_score += 100;
Destroy (this.gameObject);
}
示例5: Start
// Use this for initialization
void Start()
{
audioSou = GetComponent<AudioSource> ();
timer = 0.0f;
dashTimer = 0.0f;
weapon = GameObject.Find ("p1/Weapon");
flashlight = GameObject.Find ("p1/Flashlight");
body = GetComponent<Rigidbody2D> ();
playerMov = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerMovement> ();
isHookOn = false;
comeHere = false;
goAway = false;
applyDash = false;
canDash = true;
canShoot = true;
shootTimer = 0.0f;
countShootTime = false;
canShootShield = true;
shieldTimer = 0.0f;
countShieldTime = false;
isFlashlightOn = false;
hookTimer = 0.0f;
hookConstant = hookFlyingTime;
}
示例6: Awake
void Awake () {
rb = GetComponent<Rigidbody2D> ();
meleeTrigger.enabled = false;
s_movement = GetComponent<PlayerMovement> ();
}
示例7: Awake
//dan
//protected PlayerRotation PlayerRot;
// =============================================================================
// =============================================================================
// METHODS UNITY ---------------------------------------------------------------
protected virtual void Awake()
{
Config = GameObject.FindWithTag ( "Config" ).GetComponent<Config> ();
Trans = transform;
Audio = audio;
NetView = networkView;
GameObject player = GameObject.FindWithTag ( "Player" );
PlayerMov = player.GetComponent<PlayerMovement> ();
//dan
//TODO: fix player Rotation
//PlayerRot = player.GetComponent<PlayerRotation> ();
Equip = gameObject.GetComponent<Equipment> ();
if ( DisplayLeft )
{
DisplayLeft.renderer.material.color = DisplayColor;
}
if ( DisplayRight )
{
DisplayRight.renderer.material.color = DisplayColor;
}
}
示例8: Start
void Start()
{
if(confuseTime < 0.0f)
{
Debug.LogError("Please set confuseTime!");
}
playerApi = GetComponent<PlayerMovement>();
if(playerApi == null)
{
Debug.LogError("Eitcha lele! Cade o PlayerMovement no player?");
}
ResourceManager resourceApi = GameObject.FindGameObjectWithTag("ResourceManager").GetComponent<ResourceManager>();
confuseEffect = resourceApi.getTextureByName("confuse_gas_effect");
Debug.Log("Texturaaaa: " + confuseEffect.name);
alpha = GUI.color.a;
// Agora nao me pergunte pq o confuseTime ao quadrado =P
alphaDecrease = ( alpha / (confuseTime * confuseTime ) ) * Time.deltaTime;
Debug.Log("Decrease: " + alphaDecrease);
StartCoroutine(doConfusion(confuseTime, playerApi));
}
示例9: Start
void Start()
{
pMove = GameObject.FindObjectOfType<PlayerMovement>();
snowSteps = SoundManager.LoadAllFromGroup("Snowsteps");
woodSteps = SoundManager.LoadAllFromGroup("Woodsteps");
stoneSteps = SoundManager.LoadAllFromGroup("Stonesteps");
}
示例10: Start
// Use this for initialization
void Start()
{
spellAnimation = GetComponent<Animator>() as Animator;
audioReference = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<GameMaster>();
playerMove = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>();
//castingSpell = false;
}
示例11: Update
void Update()
{
if (SceneManager.GetActiveScene().buildIndex <= 1)
{
//Debug.Log("WE ARE IN MAIN MENU OR LEVEL SELECTOR");
//pregame = true;
}
else
{
if (GameObject.FindGameObjectWithTag("Player") == null)
{
playerDead = true;
}
if (playerDead)
{
if (playedDeath == false)
{
audioSource.clip = playerSound[5];
audioSource.volume = 1.0f;
audioSource.Play();
playedDeath = true;
}
}
if (GameObject.FindGameObjectWithTag("Player") == null) return;
playerMove = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>();
}
}
示例12: Start
void Start()
{
playerMovement = Camera.main.GetComponent<PlayerMovement>();
grid = GetComponent<Grid>();
if (SEED == 0)
{
SEED = Random.seed;
Random.seed = SEED;
}
else
{
Random.seed = SEED;
}
if (text == null)
{
//text = GameObject.FindGameObjectWithTag("Text").GetComponent<Text>();
}
if (text != null)
{
//text.text = "" + SEED;
}
Debug.Log("LEVEL SEED: " + SEED);
Generate();
GenerateEnemies();
}
示例13: Start
void Start()
{
player = GameObject.FindGameObjectWithTag("Player");
camCtrl = Camera.main.GetComponent<CameraControl>();
playMove = player.GetComponent<PlayerMovement>();
playLife = player.GetComponent<PlayerLife>();
}
示例14: Awake
void Awake()
{
player = GameObject.Find("Player(Goliath)").GetComponent<Transform>();
PlayerAnim = GameObject.Find("Player(Goliath)").GetComponent<PlayerMovement>();
sound = GameObject.Find("Handeler").GetComponent<SoundManager>();
}
示例15: PlayerInteract
protected override void PlayerInteract(PlayerMovement player)
{
if(m_IsDone)
{
WinSequenceManager.Instance.StartWinSequence();
}
}