예제 #1
0
    public override void Initialize(GameObject obj)  //GameObject being passed here is the weaponholder object.
    {
        // attacker = GameObject.FindWithTag("PiliChar");       // gets the attacker object to pull damage values from.
        assignDamageValue();

        MonoBehaviour.print("Initialized MeleeAbility");

        MonoBehaviour.print("Ability attacker is " + attacker);
        MonoBehaviour.print("Ability damage is " + damage);

        assignDamageValue();                                                     // Sets up potential damage value.

        launcher                  = obj.GetComponent <MeleeAttackTriggerable>(); // Grabs script that will initialize the object.
        launcher.damage           = damage;                                      // Sets damage value within the triggerable script that activates once this script is initialized.
        launcher.attacker         = attacker;                                    // Passes attacker id to the triggerable script.
        launcher.projectile       = hitbox;                                      // Passes the id of the hitbox that will be spawned when triggered.
        launcher.projectileAngled = hitboxAngle;
        launcher.doesDamage       = doesDamage;
        launcher.abilityVisual    = abilityVisual;
    }
    public override void Initialize(GameObject obj)
    {
        maTrigger = obj.GetComponent <MeleeAttackTriggerable>();

        RenewalAbility();
    }