コード例 #1
0
ファイル: UnitShooting.cs プロジェクト: JackRFuller/Strider
    protected override void Start()
    {
        base.Start();

        m_rangedWeaponData = m_unitView.UnitData.rangedWeapon;
        GetEyeHeight();
        this.enabled = false;
    }
コード例 #2
0
    //this bool is used to decide if the action is avialable to the player or not.
    public override bool CheckAvailable()
    {
        if (actioningUnit.GetComponent <Priming>() != null)
        {
            if (actioningUnit.GetComponent <Priming>().enabled == true)
            {
                return(false);
            }
        }

        if (actioningUnit.focus == null)
        {
            return(false);
        }
        if (!RangeFinder.LineOfSight(actioningUnit, actioningUnit.focus))
        {
            return(false);
        }

        if (actioningUnit.mainWeapon.weaponData.rangeType == WeaponData.Range.ranged)
        {
            RangedWeaponData rangedWeapon = actioningUnit.GetComponent <RangedWeapon>().rangedWeaponData;
            if (rangedWeapon.currentAmmo <= 0)
            {
                return(false);
            }
        }
        else if (actioningUnit.mainWeapon.weaponData.rangeType == WeaponData.Range.melee && actioningUnit.mainWeapon.weaponData.weight >= ItemData.Weight.medium)
        {
        }
        else
        {
            return(false);
        }

        if (actioningUnit.unitInfo.currentBreath > 0)
        {
            return(true);
        }

        else
        {
            return(false);
        }
    }
コード例 #3
0
 private void Awake()
 {
     rwData = weaponData as RangedWeaponData;
 }