Skip to content

Commit

Permalink
nullチェック漏れを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsnmeajp committed Jan 26, 2020
1 parent fc7492f commit e894211
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions EVMC4U/DirectionalLightReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace EVMC4U
{
public class DirectionalLightReceiver : MonoBehaviour, IExternalReceiver
{
[Header("DirectionalLightReceiver v1.0")]
[Header("DirectionalLightReceiver v1.1")]
public Light VMCControlledLight = null; //VMCディレクショナルライト制御同期
[SerializeField]
private string StatusMessage = ""; //Inspector表示用
Expand Down Expand Up @@ -116,21 +116,24 @@ private void ProcessMessage(ref uOSC.Message message)
&& (message.values[11] is float) //a
)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
col.r = (float)message.values[8];
col.g = (float)message.values[9];
col.b = (float)message.values[10];
col.a = (float)message.values[11];
if(VMCControlledLight != null && VMCControlledLight.transform != null)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
col.r = (float)message.values[8];
col.g = (float)message.values[9];
col.b = (float)message.values[10];
col.a = (float)message.values[11];

VMCControlledLight.transform.localPosition = pos;
VMCControlledLight.transform.localRotation = rot;
VMCControlledLight.color = col;
VMCControlledLight.transform.localPosition = pos;
VMCControlledLight.transform.localRotation = rot;
VMCControlledLight.color = col;
}
}
}
}
Expand Down

0 comments on commit e894211

Please sign in to comment.