Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        UnitParts hitParts = other.GetComponent <UnitParts>();

        if (hitParts != null)
        {
            if (hitParts.Owner != owner)
            {
                int      power    = Power + Random.Range(-PowerRange, PowerRange + 1);
                PartsLeg partsLeg = other.GetComponent <PartsLeg>();
                if (partsLeg)
                {
                    GameObject hit        = Instantiate(damage);
                    DamageText damageText = hit.GetComponent <DamageText>();
                    damageText.ViewDamege(power / 3, transform.position);
                    EffectManager.PlayEffect(EffectID.Hit, blade.transform.position);
                    hitParts.Damage(power / 3);
                }
                else
                {
                    GameObject hit        = Instantiate(damage);
                    DamageText damageText = hit.GetComponent <DamageText>();
                    damageText.ViewDamege(power, transform.position);
                    EffectManager.PlayEffect(EffectID.Hit, blade.transform.position);
                    hitParts.Damage(power);
                }
                SoundManager.Instance.PlaySE(SEType.Hit);
            }
        }
        else
        {
            Armor armor = other.GetComponent <Armor>();
            if (armor)
            {
                EffectManager.PlayEffect(EffectID.Hit, blade.transform.position);
                armor.ArmorDamage();
                GameObject hit        = Instantiate(damage);
                DamageText damageText = hit.GetComponent <DamageText>();
                damageText.ViewDamege(1, transform.position);
            }
            else
            {
                Obstacle obstacle = other.GetComponent <Obstacle>();
                if (obstacle)
                {
                    EffectManager.PlayEffect(EffectID.Hit, blade.transform.position);
                    obstacle.ObstacleHit(Power);
                }
            }
        }
    }
Пример #2
0
 public void LegData(PartsLeg leg)
 {
     guideText.text = "部品名:" + leg.GetName() + "\n耐久値:" + leg.GetMaxHP() + "\n装甲値:" + leg.GetArmorDefense() + "×" + leg.GetArmorPoint()
                      + "\n重量:" + leg.GetWeight() + "\n移動力:" + leg.GetMovePower() + "\n昇降力:" + leg.GetLiftingForce() + "\n価格:" + leg.GetPrice() + "\n備考:" + leg.GetGuide();
 }