﻿// Decompiled with JetBrains decompiler
// Type: ShakeObject
// Assembly: Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 19851F1B-4780-4223-BA01-2C20F2CD781E
// Assembly location: C:\Users\CGA Computer\Desktop\LEGO Universe Stuff\LOCO Server\Unity Web Player Extractor\Saved Files\LOCO Server.unity3d_unpacked\Assembly-CSharp.dll

using UnityEngine;

public class ShakeObject : MonoBehaviour
{
  private Vector3 startPos;
  private Vector3 startRot;
  public float shakePos;
  public float shakeRot;
  public bool rot;
  public bool pos;
  private bool Enable;
  public bool StartOnAwake;

  public ShakeObject()
  {
    base.\u002Ector();
  }

  private void Start()
  {
    this.startPos = ((Component) this).get_transform().get_localPosition();
    this.startRot = ((Component) this).get_transform().get_localEulerAngles();
    if (!this.StartOnAwake)
      return;
    this.Enable = true;
  }

  private void Update()
  {
    if (!this.Enable)
      return;
    if (this.pos)
      ((Component) this).get_transform().set_localPosition(new Vector3((float) (this.startPos.x + (double) Random.get_value() * (double) this.shakePos), (float) (this.startPos.y + (double) Random.get_value() * (double) this.shakePos), (float) (this.startPos.z + (double) Random.get_value() * (double) this.shakePos)));
    if (!this.rot)
      return;
    ((Component) this).get_transform().set_localEulerAngles(new Vector3((float) (this.startRot.x + (double) Random.get_value() * (double) this.shakeRot), (float) (this.startRot.y + (double) Random.get_value() * (double) this.shakeRot), (float) (this.startRot.z + (double) Random.get_value() * (double) this.shakeRot)));
  }

  public void ShakeIt()
  {
    this.Enable = true;
  }

  public void StopShakingIt()
  {
    this.Enable = false;
  }
}
