Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     remainRepair = repairTime;
     repairBar.gameObject.SetActive(false);
     startTimer = timer;
     ship       = FindObjectOfType <ShipDamage>();
 }
Пример #2
0
    public void shipDamaged(ShipDamage damage)
    {
        damagedSections++;

        if (damagedSections >= damagedToSink)
        {
            //Sink ship
        }
    }
Пример #3
0
    public new void Start()
    {
        damageScript = GameObject.FindGameObjectWithTag("Player").GetComponent <ShipDamage>();
        TotalValue   = damageScript.TotalHealth;
        CurrentValue = TotalValue - damageScript.Damage;
        MinAngle     = startAngle;
        MaxAngle     = finishAngle;

        base.Start();
    }
Пример #4
0
    public new void Start()
    {
        damageScript = GameObject.FindGameObjectWithTag("Player").GetComponent<ShipDamage>();
        TotalValue = damageScript.TotalHealth;
        CurrentValue = TotalValue - damageScript.Damage;
        MinAngle = startAngle;
        MaxAngle = finishAngle;

        base.Start();
    }
Пример #5
0
 void Awake()
 {
     movement = GetComponent <ShipMovement>();
     damage   = GetComponent <ShipDamage>();
     shooter  = GetComponent <ShipShooterManager>();
     positiveThrottle.fillAmount = 0;
     negativeThrottle.fillAmount = 0;
     positiveSteering.fillAmount = 0;
     negativeSteering.fillAmount = 0;
 }
Пример #6
0
    private void OnTriggerEnter(Collider other)
    {
        ShipDamage shipCollided = other?.GetComponent <ShipDamage>();

        if (shipCollided != null)
        {
            if (shipCollided.GetTeam() != m_Team)
            {
                ConfirmHit();
            }
        }
    }
Пример #7
0
 private void Start()
 {
     timer  = startTimer;
     player = FindObjectOfType <PlayerMovement>();
     ship   = FindObjectOfType <ShipDamage>();
 }