Beispiel #1
0
 private void BufferMe(bool passed)
 {
     if (passed == false)
     {
         InputBuffer.BufferAbility(this);
     }
 }
Beispiel #2
0
    public virtual void CreateWeapon()
    {
        if (Source.Entity().WeaponCreated == true)
        {
            //Debug.Log("Weapon already made");

            if (parentAbility.OverrideOtherAbilities)
            {
                Source.Entity().CurrentWeapon.CleanUp();
            }
            else
            {
                InputBuffer.BufferAbility(parentAbility);
                return;
            }
        }

        //Debug.Log("makin' a weapon for " + parentAbility.abilityName);

        GameObject loadedPrefab = VisualEffectLoader.LoadVisualEffect("Weapons", weaponPrefabName);

        if (loadedPrefab == null)
        {
            Debug.LogError("Couldn't Load " + weaponPrefabName);
            return;
        }

        Transform point = Source.Entity().EffectDelivery.GetOriginPoint(effectOrigin);

        GameObject activeWeapon = GameObject.Instantiate(loadedPrefab, point);

        activeWeapon.transform.SetParent(point, false);
        activeWeapon.transform.localPosition = Vector3.zero;

        if (Source.Entity().Movement.Facing == EntityMovement.FacingDirection.Left)
        {
            activeWeapon.transform.localScale = new Vector3(
                activeWeapon.transform.localScale.x * -1,
                activeWeapon.transform.localScale.y,
                activeWeapon.transform.localScale.z);
        }

        WeaponDelivery delivery = activeWeapon.GetComponentInChildren <WeaponDelivery>();

        delivery.AnimHelper.PlayAnimTrigger(weaponAnimTrigger);
        Source.Entity().CurrentWeapon = delivery;
        Source.Entity().WeaponCreated = true;
        delivery.Initialize(this);
    }