示例#1
0
    protected virtual void Awake()
    {
        user   = transform.parent.GetComponent <BaseCharacter> ();
        hitBox = GetComponent <Collider> ();

        stats       = GetComponent <BaseEquipmentProperties> ();
        moveset     = GetComponent <BaseEquipmentMovesetModule> ();
        weaponState = GetComponent <BaseEquipmentStateModule> ();
    }
示例#2
0
    protected virtual void Awake()
    {
        user = transform.parent.GetComponent<BaseCharacter> ();
        hitBox = GetComponent<Collider> ();

        stats = GetComponent<BaseEquipmentProperties> ();
        moveset = GetComponent<BaseEquipmentMovesetModule> ();
        weaponState = GetComponent <BaseEquipmentStateModule> ();
    }
示例#3
0
 protected virtual void Awake()
 {
     hitBox = GetComponent<BoxCollider> ();
     user = transform.root.GetComponent<BaseCharacter> ();
     weaponProperties = GetComponent<BaseEquipmentProperties> ();
 }
    //    public override void OnTriggerEnter (Collider hit) {
    //        Debug.Log ("Hit Registered!");
    //        BaseCharacter target;
    //
    //        if (hit.transform.GetComponent<BaseCharacter>()) {
    //            Debug.LogError ("LANDED A HIT!!!");
    //            target = hit.transform.GetComponent<BaseCharacter> ();
    //            if (target.CharType != User.CharType)
    //                target.CharActions.CharStatus.ApplyAttack (this, User.Coordinates);
    //        } else
    //            Debug.LogError ("Well something weird is going on...");
    ////		_weapon.ActiveAttack = null;
    //    }
    public override void SetValue(BaseEquipment weapon, BaseEquipmentProperties.EquipmentActions name)
    {
        base.SetValue (weapon, name);
        //		Debug.LogError ("Setting weapon values...");
        switch (attackType) {
        case AttackPropertyType.Standard:
            enterAbility = delegate {
                direction = (CharInput.LookDir - User.Coordinates.position);
                if (_weapon.ActiveAttack != this)
                    _weapon.ActiveAttack = this;

                _weapon.WeaponProperties.anim.material.color = Color.grey;
            };
            activeAbility = delegate {
                _hitbox.enabled = true;
                Aim ();
                BurstMove (activeMoveSpeed);
                _weapon.WeaponProperties.anim.material.color = Color.red;
            };
            exitAbility = delegate {
                _hitbox.enabled = false;
                _weapon.WeaponProperties.anim.material.color = Color.grey;
            };
            break;

        case AttackPropertyType.Charge:
        case AttackPropertyType.Multi:
        case AttackPropertyType.Counter:
        default:
            Debug.LogError ("Attack Type was not set properly!");
            break;
        }
    }
 public virtual void SetValue(BaseEquipment weapon, BaseEquipmentProperties.EquipmentActions name)
 {
     base.SetValue (weapon.User);
     _weapon = weapon;
     _hitbox = weapon.HitBox;
     attackName = name;
 }