Exemple #1
0
	void Awake () {
    dem = GameObject.Find("Field Objects").GetComponent<DangerousEMPManager>();
    rotatingSpeed = dem.empRotatingSpeed;
    enlargeDuration = dem.enlargeDuration;
    stayDuration = dem.stayDuration;
    shrinkDuration = dem.shrinkDuration;
  }
Exemple #2
0
  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");
  }