void Start() { attackList = new AbstractAttack[7]; attackList[0] = crouchingAttack; attackList[1] = standingNeutral; attackList[2] = standingAir; attackList[3] = airNeutral; attackList[4] = airBack; attackList[5] = airFront; attackList[6] = airDown; if (useActorForce) { forceType = GetComponent <Actor>().forceType; } for (int i = 0; i < attackList.Length; i++) { _tempAtk = (AbstractAttack)Instantiate(attackList[i], this.transform.position, Quaternion.identity) as AbstractAttack; _tempAtk.transform.parent = this.transform; _tempAtk.forceType = forceType; attackList[i] = _tempAtk; } }
/// <summary> /// Sets the 'force' of the attack. This means what color it has, or what team it belongs to. /// </summary> /// <param name="_force">The force value.</param> public void SetForce(Properties.ForceType _force) { forceType = _force; for (int i = 0; i < m_childHurtBoxes.Length; i++) { m_childHurtBoxes[i].SetForce(_force); } }
/// <summary> /// Initialize the page. Used instead of the default MonoBehaviour Start() to ensure that things /// are created in a particular order. /// </summary> public virtual void Init() { m_attacks = new AbstractAttack[4]; m_attacks[0] = standingNeutral; m_attacks[1] = standingDirectional; m_attacks[2] = airNeutral; m_attacks[3] = airDirectional; if (useActorForce) { forceType = parent.GetComponent <Actor>().forceType; } AbstractAttack _tempAtk; for (int i = 0; i < m_attacks.Length; i++) { _tempAtk = (AbstractAttack)Instantiate(m_attacks[i], this.transform.position, Quaternion.identity) as AbstractAttack; _tempAtk.transform.parent = parent.transform; _tempAtk.forceType = forceType; m_attacks[i] = _tempAtk; } }
/// <summary> /// Set the force type of the current hurt box. Used in the Attack method that houses the HurtBoxes. /// </summary> /// <param name="_type"></param> public void SetForce(Properties.ForceType _type) { forceType = _type; }