void Awake () { dem = GameObject.Find("Field Objects").GetComponent<DangerousEMPManager>(); rotatingSpeed = dem.empRotatingSpeed; enlargeDuration = dem.enlargeDuration; stayDuration = dem.stayDuration; shrinkDuration = dem.shrinkDuration; }
protected override void initializeRest() { dem = (DangerousEMPManager)objectsManager; canBeMagnetized = false; minScale = dem.minScale; maxScale = dem.maxScale; startDuration = dem.startDuration; decreaseDurationPerPulse = dem.decreaseDurationPerPulse; diff = maxScale - minScale; shellTr = transform.Find("Shell"); shellRenderer = shellTr.GetComponent<Renderer>(); originalColor = shellRenderer.sharedMaterial.GetColor("_TintColor"); float duration = startDuration; while (duration > 0) { colorChangeDuration += duration; duration -= decreaseDurationPerPulse; } dangerousArea = transform.Find("DangerousArea"); }