private void Start() { if (GetComponent <ShakeObject>()) { sO = GetComponent <ShakeObject>(); } }
private void SetShakeObject(Component component) { if (component != null) { _shakeObject = new ShakeObject(component.GetComponent <RectTransform>()); } }
public void ShakeCamera(float amount) { ShakeObject cameraShake = GameObject.Find("CameraManager").GetComponent <ShakeObject> (); cameraShake.smooth = false; cameraShake.smoothAmount = 5f; float clampedAmount = Mathf.Clamp(amount, 0.2f, 0.8f); cameraShake.ShakeCamera(clampedAmount, clampedAmount * 0.05f); }
private void Awake() { if (this.GetComponent <ItemController>() == null) { ItemsManager = this.gameObject.AddComponent <ItemController>(); } else { ItemsManager = this.gameObject.GetComponent <ItemController>(); } if (this.GetComponent <ShakeObject>() == null) { ObjectShaker = this.gameObject.AddComponent <ShakeObject>(); } else { ObjectShaker = this.gameObject.GetComponent <ShakeObject>(); } }
void Start() { shakeObject = GetComponent <ShakeObject> (); }
private void Start() { strumScript = FindObjectOfType <Strum>(); shaker = GetComponentInChildren <ShakeObject>(); thisSpeaker = GetComponent <AudioSource>(); }