void Update() { ShieldSizeUpdate(); BorderLinesMarkerRotating(); playerCollider = Physics.OverlapSphere(detectShieldOriginTransform.position, currentShieldRadius, layerMask_player); if (playerCollider.Length > 0) { if (shipEntity.CurrentWeight > 0.0f || shipEntity.GetShipOresAmount(Global.OresTypes.FinalKey) > 0.0f) { shipEntity.UnloadResources(this, ref storageOresResources, ref finalStorageOresResources); Debug.Log(finalStorageOresResources[Global.OresTypes.FinalKey]); Debug.Log(finalStorageOresResources[Global.OresTypes.Ore_No1]); //Debug.Log("Iron = " + storageOresResources[Global.OresTypes.Ore_No1]); //Debug.Log("No2_Ores = " + storageOresResources[Global.OresTypes.Special_Ore]); //RepairTheShield(); } shipEntity.ReplenishHealthPoint(this); shipEntity.ReplenishNitroPoint(this); if (!isPlayerInBase) { isPlayerInBase = true; } } else if (isPlayerInBase) { isPlayerInBase = false; } }
// Update is called once per frame void Update() { healthPointSlider.value = shipEntity.CurrentHealth; nitroPointImage.fillAmount = (eachNitroPointRate * shipEntity.CurrentNitro) + coverNitroPointRate; weightPointSlider.value = shipEntity.CurrentWeight; oreAmountText.text = shipEntity.GetShipOresAmount(Global.OresTypes.Ore_No1).ToString() + text_OreAmount; //rawNumber = (int)baseSystem.CurrentShieldRadius; //radixPoint = (int)((baseSystem.CurrentShieldRadius - (int)baseSystem.CurrentShieldRadius) * 100); timeValueRawNumber = (int)(timerManager.CurrentTime * 1) / 60; //((int)(baseSystem.CurrentShieldRadius * 100) / 60); timeValueRadixPoint = (int)(timerManager.CurrentTime * 1) % 60; //((int)(baseSystem.CurrentShieldRadius * 100) % 60); timerText.text = timeValueRawNumber.ToString() + ":" + ((timeValueRadixPoint < 10) ? ("0" + timeValueRadixPoint.ToString()) : timeValueRadixPoint.ToString()); distanceBetweenShipAndBase = baseTransform.position.magnitude - shipTransform.position.magnitude; // Count the distance between base and ship int countRate = 0; for (int i = 0; i < (int)Global.ZoneLevels.Length; i++) { if (Mathf.Abs(distanceBetweenShipAndBase) > Global.zonesRadius[i]) { countRate++; } else { break; } } ZoneDifficulty((Global.ZoneLevels)countRate); distanceBetweenShipAndBase = (int)(distanceBetweenShipAndBase * 100f); // Getting radix point first step (3.200f * 100) distanceBetweenShipAndBase = distanceBetweenShipAndBase / 100f; // Getting radix point last step distanceBetweenShipAndBaseText.text = text_DistanceBetweenShipAndBase + Mathf.Abs(distanceBetweenShipAndBase).ToString() + "m"; Vector3 shipAndBaseNormalized = (shipTransform.position - baseTransform.position).normalized; basePointerTransform.LookAt(baseTransform.position); basePointerTransform.position = shipTransform.position - (shipAndBaseNormalized * 1.5f); }