// Use this for initialization void Start () { ac = this.gameObject.GetComponent<AttributeComponent>(); bc = this.gameObject.GetComponent<BoxCollider2D>(); pbc = GameObject.FindWithTag ("Projectile").GetComponent <BoxCollider2D>(); anim = (Animator)GetComponent(typeof(Animator)); meleeSys = (MeleeSystem)GetComponent(typeof(MeleeSystem)); }
// Use this for initialization void Start() { if (networkView.isMine == true) { myTransform = transform; spawn = GameObject.Find("SpawnManager").GetComponent <SpawnScript>(); manaScript = gameObject.GetComponent <Mana>(); meleeScript = gameObject.GetComponent <MeleeSystem>(); if (spawn.amIOnTheRedTeam == true) { iAmOnTheRedTeam = true; } if (spawn.amIOnTheBlueTeam == true) { iAmOnTheBlueTeam = true; } } else { enabled = false; } source = gameObject.GetComponent <AudioSource>(); }
// Use this for initialization void Start () { attComp = (AttributeComponent)gameObject.GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)gameObject.GetComponent(typeof(CharacterMovement)); meleeSys = (MeleeSystem)gameObject.GetComponent(typeof(MeleeSystem)); rangedSys = (RangedSystem)GetComponent(typeof(RangedSystem)); abilitySys = (AbilitySystem)GetComponent(typeof(AbilitySystem)); }
// Use this for initialization void Start() { health = maxHealth; stamina = maxStamina = 100f; meleeSys = (MeleeSystem)GetComponent(typeof(MeleeSystem)); }
// Use this for initialization void Start() { ac = this.gameObject.GetComponent <AttributeComponent>(); bc = this.gameObject.GetComponent <BoxCollider2D>(); pbc = GameObject.FindWithTag("Projectile").GetComponent <BoxCollider2D>(); anim = (Animator)GetComponent(typeof(Animator)); meleeSys = (MeleeSystem)GetComponent(typeof(MeleeSystem)); }
// Use this for initialization void Start() { attComp = (AttributeComponent)gameObject.GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)gameObject.GetComponent(typeof(CharacterMovement)); meleeSys = (MeleeSystem)gameObject.GetComponent(typeof(MeleeSystem)); rangedSys = (RangedSystem)GetComponent(typeof(RangedSystem)); abilitySys = (AbilitySystem)GetComponent(typeof(AbilitySystem)); }
void Start() { rb = GetComponent <Rigidbody>(); movement = GetComponent <PlayerMovement>(); rangedWeaponHandler = GetComponentInChildren <RangedWeaponHandler>(); meleeSystem = GetComponent <MeleeSystem>(); currentState = PlayerState.BasicPlayerState; currentBasicPlayerState = PlayerState.Movement; }
private void OnEnable() { current = this; // Visuals playerSprite = GetComponent <SpriteRenderer>(); spriteAnimator = GetComponent <SpriteAnimator>(); dashGhosts = GetComponent <Ghost>(); // Attacking shootingScript = GetComponent <Shooting>(); meleeSystem = GetComponent <MeleeSystem>(); // Health playerHealth = FindObjectOfType <PlayerHealth>(); }
private void Start() { // Player Components playerController = PlayerController.current; shootingScript = PlayerController.shootingScript; meleeSystem = PlayerController.meleeSystem; // Dialogue manager dialogueManager = GetComponent <DialogueManager>(); controls.Player.Disable(); controls.Player.Enable(); #region Gameplay Input // Jumping controls.Player.Jump.started += ctx => { playerController.RecieveJumpInput(); jumpHeld = true; }; controls.Player.Jump.canceled += ctx => jumpHeld = false; // Shooting controls.Player.Fire.started += ctx => { shootingScript.InitialShot(); shootHeld = true; }; controls.Player.Fire.canceled += ctx => { shootingScript.ReleaseShot(); shootHeld = false; }; // Attacking controls.Player.Attack.started += ctx => meleeSystem.Attack(); // Dashing controls.Player.Dash.started += ctx => { playerController.InitializeDash(); dashReleased = false; }; controls.Player.Dash.canceled += ctx => dashReleased = true; // Interaction controls.Player.Interact.started += ctx => CheckForItem(); // Pause Menu controls.Player.Pause.started += ctx => Pause(); controls.Pause.Unpause.started += ctx => EscUnpause(); // Dialogue controls.Dialogue.Next.started += ctx => dialogueManager.OnButtonPressed(); controls.Dialogue.Next.canceled += ctx => dialogueManager.OnButtonReleased(); #endregion }
protected override void Awake() { base.Awake(); switcher = GetComponent <PlayerEquipmentSwitcher>(); meleeSys = GetComponent <PlayerMeleeSystem>(); }
// Use this for initialization void Start () { health = maxHealth; stamina = maxStamina = 100f; meleeSys = (MeleeSystem)GetComponent(typeof(MeleeSystem)); }