void enableSwingRecording(MeleeController sender) { recording = true; tracerPoint = GetComponentInChildren <Tracer>().gameObject; origin = gameObject.transform.position; index = 0; }
protected override void Effect() { player = GameObject.FindGameObjectWithTag("Player"); anim = player.GetComponent <Animator>(); anim.speed = anim.speed + melee; meleeController = player.GetComponent <MeleeController>(); meleeController.SetAttackCoolDown(meleeController.GetAttackCooldown() - melee); }
void disableSwingRecording(MeleeController sender) { recording = false; if (firstIteration) { firstIteration = false; } }
public void Start() { animator = parent.GetComponent <Animator>(); pointPaths = new List <Vector3>(); controller = parent.GetComponent <MeleeController>(); controller.SwingBegan += enableSwingRecording; controller.SwingFinished += disableSwingRecording; }
public void addTeamMember(MeleeController controller) { teamMembers.Add(controller); controller.Team = this; if (MeleeController.isAi(controller)) { npcs.Add((AIController)controller); } }
// Use this for initialization void OnEnable() { cgl = GameObject.FindGameObjectWithTag("GameController").GetComponent <CoreGameLoop>(); ammo = new Amunition(450, 30); props = new M4A1WeaponProperties(); rof = this.getRof(); gunSmoke.Stop(); melee = meleeGo.GetComponent <MeleeController> (); }
public Block(AIController controller) { this.controller = controller; tacticalControl = controller.TacticalControl; target = tacticalControl.Target; enemyController = tacticalControl.analyzer.enemy; enemyController.EnableWeapon += EnemyOffensiveActionStart; enemyController.SwingFinished += EnemyOffensiveActionEnd; timeToAttackTransition = (float)MeleeController.r.NextDouble() * maxTimeToAttackTransition; }
void OnTriggerEnter(Collider other) { Debug.Log("collide"); switch (other.tag) { case "Damager": Debug.Log(name + " has hit " + other.name); MeleeController melee = other.GetComponent <MeleeController>(); TakeDamage(facingDirection, melee.damage, melee.knockback); break; } }
void Start() { nightController = NightControllerObj.GetComponent <NightController>(); audioSource = GetComponent <AudioSource>(); spriteRenderer = PlayerSpriteObj.GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); meleeController = MeleeColliderObj.GetComponent <MeleeController>(); buffBarController = BuffBarObj.GetComponent <BuffBarController>(); buffBarController.buffDuration = buffDuration; meleeController.Damage = MeleeDamage; movespeed = 1.2f + (1.2f * (GlobalDataScript.SpeedBonus / 100f)); }
bool damaged; // True when the player gets damaged. void Awake() { // Setting up the references. anim = GetComponent <Animator> (); meleeMovement = GetComponentInParent <MeleeController> (); meleeAttack = GetComponentInParent <MeleeAttack> (); meleeAttackBlue = GetComponentInChildren <MeleeAttackBlue> (); // Set the initial health of the player. currentHealth = startingHealth; }
public void equipItem(int i, Bodypart part, MeleeController controller) { var g = loadItem(i); var equipment = g.GetComponent <Equipment>(); if (equipment == null) { return; } var slots = new List <Bodypart>(equipment.equippableSlots); if (!slots.Contains(part)) { return; } controller.skeletonMap[part].GetComponent <HandManager>().equip(g, true); }
public void InitController() { player = GameObject.FindGameObjectWithTag("Player"); if (player != null) { goldController = player.GetComponent <GoldController>(); lifeController = player.GetComponent <LifeController>(); fireController = player.GetComponent <FireController>(); meleeController = player.GetComponent <MeleeController>(); playerController = player.GetComponent <PlayerController>(); playerMove = player.GetComponent <PlayerMove>(); upgradeController = player.GetComponent <UpgradeController>(); } else { Debug.LogError("Player not Initialized"); } }
private void Awake() { gunController = GetComponent <GunController>(); controller = GetComponent <PlayerController>(); meleeController = GetComponent <MeleeController>(); inventoryController = GetComponent <PlayerInventoryController>(); viewCamera = Camera.main; FindObjectOfType <Spawner>().OnNewWave += OnNewWave; if (startingGun != null) { gunController.AddGun(startingGun); } else { gunController.AddGun(0); } meleeController.EquippedMeleeWeapon(startingMeleeWeapon); }
// Update is called once per frame void Update() { texto.text = "100 - " + vida; contador += Time.deltaTime; if (Input.GetButton("Change") && tieneKatana && contador > 1.5) { if (!armaActiva) //Tiene el rifle { ControllerArmas.Deactivate(); MeleeController.Activate(); armaActiva = !armaActiva; } else //tiene la katana { MeleeController.Deactivate(); ControllerArmas.Activate(); armaActiva = !armaActiva; } contador = 0; } }
void Start() { //Get All Controller player = GameObject.FindGameObjectWithTag("Player"); upgradeController = player.GetComponent <UpgradeController>(); goldController = player.GetComponent <GoldController>(); lifeController = player.GetComponent <LifeController>(); fireController = player.GetComponent <FireController>(); playerController = player.GetComponent <PlayerController>(); meleeController = player.GetComponent <MeleeController>(); playerController.SetShopDisabled(false); Hud(); //Create Listener EXIT Button btn = yourButton.GetComponent <Button>(); btn.onClick.AddListener(Exit); }
void disableSwingRecording(MeleeController sender) { tracing = false; }
private void Update() { //press q to restart the level if (Input.GetKeyDown("q")) { RestartLevel(); } //if you all die, level restarts for (int i = 0; i < deathcount.Length; i++) { if (deathcount[0] == 1 && deathcount[1] == 1 && deathcount[2] == 1 && deathcount[3] == 1) { RestartLevel(); } } #region PlayerIDStuff #region CharacterAssignment /*Checks a bunch of arrays that hold IDs and GameObjects to eventually assign an unassigned character to a controller ID, this is the basis of our character selection method. * STEP BY STEP: * -checks if the index contains the player ID given by the Joystick Polling Script * -Checks if that index value is null * -if so it loops through the buttons pressed by the joystick assigned that index value * -if the specified button is pressed, it checks to see if the array contains that character already * -if not, it assigns the character to that controller ID. */ if (/*Input.GetKeyDown("joystick 1 button 7")*/ PID.Contains(1)) { if (Player[PID.IndexOf(1)] == null) { if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(1)] + " button 0")) { if (!Player.Contains(IDs[0].gameObject)) { Player.Insert(PID.IndexOf(1), IDs[0].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); tankcontroller = GameObject.Find("Tank Character(Clone)").GetComponent <TankController>(); tankcontroller.CTRLID = 1; IDs[0].gameObject.transform.position = GameObject.Find("P0Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(1)] + " button 1")) { if (!Player.Contains(IDs[1].gameObject)) { Player.Insert(PID.IndexOf(1), IDs[1].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); healercontroller = GameObject.Find("Healer Character(Clone)").GetComponent <HealerController>(); healercontroller.CTRLID = 1; IDs[1].gameObject.transform.position = GameObject.Find("P0Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(1)] + " button 2")) { if (!Player.Contains(IDs[2].gameObject)) { Player.Insert(PID.IndexOf(1), IDs[2].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); meleecontroller = GameObject.Find("Melee Character(Clone)").GetComponent <MeleeController>(); meleecontroller.CTRLID = 1; IDs[2].gameObject.transform.position = GameObject.Find("P0Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(1)] + " button 3")) { if (!Player.Contains(IDs[3].gameObject)) { Player.Insert(PID.IndexOf(1), IDs[3].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); rangedcontroller = GameObject.Find("Ranged Character(Clone)").GetComponent <RangedController>(); rangedcontroller.CTRLID = 1; IDs[3].gameObject.transform.position = GameObject.Find("P0Select").transform.position; } } else { } } } if (/*Input.GetKeyDown("joystick 1 button 7")*/ PID.Contains(2)) { if (Player[PID.IndexOf(2)] == null) { if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(2)] + " button 0")) { if (!Player.Contains(IDs[0].gameObject)) { Player.Insert(PID.IndexOf(2), IDs[0].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); tankcontroller = GameObject.Find("Tank Character(Clone)").GetComponent <TankController>(); tankcontroller.CTRLID = 2; IDs[0].gameObject.transform.position = GameObject.Find("P1Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(2)] + " button 1")) { if (!Player.Contains(IDs[1].gameObject)) { Player.Insert(PID.IndexOf(2), IDs[1].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); healercontroller = GameObject.Find("Healer Character(Clone)").GetComponent <HealerController>(); healercontroller.CTRLID = 2; IDs[1].gameObject.transform.position = GameObject.Find("P1Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(2)] + " button 2")) { if (!Player.Contains(IDs[2].gameObject)) { Player.Insert(PID.IndexOf(2), IDs[2].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); meleecontroller = GameObject.Find("Melee Character(Clone)").GetComponent <MeleeController>(); meleecontroller.CTRLID = 2; IDs[2].gameObject.transform.position = GameObject.Find("P1Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(2)] + " button 3")) { if (!Player.Contains(IDs[3].gameObject)) { Player.Insert(PID.IndexOf(2), IDs[3].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); rangedcontroller = GameObject.Find("Ranged Character(Clone)").GetComponent <RangedController>(); rangedcontroller.CTRLID = 2; IDs[3].gameObject.transform.position = GameObject.Find("P1Select").transform.position; } } else { } } } if (/*Input.GetKeyDown("joystick 1 button 7")*/ PID.Contains(3)) { if (Player[PID.IndexOf(3)] == null) { if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(3)] + " button 0")) { if (!Player.Contains(IDs[0].gameObject)) { Player.Insert(PID.IndexOf(3), IDs[0].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); tankcontroller = GameObject.Find("Tank Character(Clone)").GetComponent <TankController>(); tankcontroller.CTRLID = 3; IDs[0].gameObject.transform.position = GameObject.Find("P2Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(3)] + " button 1")) { if (!Player.Contains(IDs[1].gameObject)) { Player.Insert(PID.IndexOf(3), IDs[1].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); healercontroller = GameObject.Find("Healer Character(Clone)").GetComponent <HealerController>(); healercontroller.CTRLID = 3; IDs[1].gameObject.transform.position = GameObject.Find("P2Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(3)] + " button 2")) { if (!Player.Contains(IDs[2].gameObject)) { Player.Insert(PID.IndexOf(3), IDs[2].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); meleecontroller = GameObject.Find("Melee Character(Clone)").GetComponent <MeleeController>(); meleecontroller.CTRLID = 3; IDs[2].gameObject.transform.position = GameObject.Find("P2Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(3)] + " button 3")) { if (!Player.Contains(IDs[3].gameObject)) { Player.Insert(PID.IndexOf(3), IDs[3].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); rangedcontroller = GameObject.Find("Ranged Character(Clone)").GetComponent <RangedController>(); rangedcontroller.CTRLID = 3; IDs[3].gameObject.transform.position = GameObject.Find("P2Select").transform.position; } } else { } } } if (/*Input.GetKeyDown("joystick 1 button 7")*/ PID.Contains(4)) { if (Player[PID.IndexOf(4)] == null) { if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(4)] + " button 0")) { if (!Player.Contains(IDs[0].gameObject)) { Player.Insert(PID.IndexOf(4), IDs[0].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); tankcontroller = GameObject.Find("Tank Character(Clone)").GetComponent <TankController>(); tankcontroller.CTRLID = 4; IDs[0].gameObject.transform.position = GameObject.Find("P3Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(4)] + " button 1")) { if (!Player.Contains(IDs[1].gameObject)) { Player.Insert(PID.IndexOf(4), IDs[1].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); healercontroller = GameObject.Find("Healer Character(Clone)").GetComponent <HealerController>(); healercontroller.CTRLID = 4; IDs[1].gameObject.transform.position = GameObject.Find("P3Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(4)] + " button 2")) { if (!Player.Contains(IDs[2].gameObject)) { Player.Insert(PID.IndexOf(4), IDs[2].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); meleecontroller = GameObject.Find("Melee Character(Clone)").GetComponent <MeleeController>(); meleecontroller.CTRLID = 4; IDs[2].gameObject.transform.position = GameObject.Find("P3Select").transform.position; } } else if (Input.GetKeyDown("joystick " + PID[PID.IndexOf(4)] + " button 3")) { if (!Player.Contains(IDs[3].gameObject)) { Player.Insert(PID.IndexOf(4), IDs[3].gameObject); // Player.RemoveAt(Player.Count - 1); Player.Remove(null); rangedcontroller = GameObject.Find("Ranged Character(Clone)").GetComponent <RangedController>(); rangedcontroller.CTRLID = 4; IDs[3].gameObject.transform.position = GameObject.Find("P3Select").transform.position; } } else { } } } }
void Awake() { base.Awake(); meleeController = GetComponent <MeleeController>(); damageable = target.GetComponent <Virus>(); }
public MeleeAttackEvent(MeleeController melee) { this.melee = melee; }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { controller = animator.gameObject.GetComponent <MeleeController>(); damageManager = controller.damageManager; controller.OnBlockBegin(new EventArgs()); }
void Start() { spellController = gameObject.GetComponent <SpellController>(); meleeController = gameObject.GetComponent <MeleeController>(); }
void enableSwingRecording(MeleeController sender) { tracing = true; }
public void OnEquip(MeleeController controller) { this.controller = controller; controller.SwingBegan += enableSwingRecording; controller.SwingFinished += disableSwingRecording; }
public void EnemyOffensiveActionEnd(MeleeController controller) { //acceptingCounterAttackResponses = true; //controller.executeBlock(false); }