0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Unity】Cinemachine Impulse Source をスクリプトから設定

Last updated at Posted at 2023-09-21

概要

Cinemachine Impulse Source 内のいくつかの変数を、スクリプトから自動で設定したくなったので調査したので結果をまとめておく。

Impulse Type

Legacy に設定する。

ImpulseModule.cs
var definition = GetComponent<CinemachineImpulseSource>().m_ImpulseDefinition;
definition.m_ImpulseType = CinemachineImpulseDefinition.ImpulseTypes.Legacy;

Raw Signal

6D Shakeを設定する

ImpulseModule.cs
var definition = GetComponent<CinemachineImpulseSource>().m_ImpulseDefinition;
definition.m_RawSignal = UnityEditor.AssetDatabase.LoadAssetAtPath<SignalSourceAsset>("Assets/Datas/Misc/6D Shake.asset");

Frequency Gain

5を設定する

ImpulseModule.cs
var definition = GetComponent<CinemachineImpulseSource>().m_ImpulseDefinition;
definition.m_FrequencyGain = 5;
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?