view Paper/src/Unity/ObjectMoveCodeGear.cs @ 32:f6120b4d214a

update Unity chaper
author riono <e165729@ie.u-ryukyu.ac.jp>
date Sat, 05 Feb 2022 01:44:53 +0900
parents
children
line wrap: on
line source

public class ObjectMoveCodeGear : CodeGear {
    [Peek] private Transform otherTransform;
    [Take] public Vector3Cmd newPos;

    public override void Run(CodeGearManager cgm) {
        MainThreadDispatcher.Post(_ => {
            Vector3 pos = new Vector3(newPos.xAxis, newPos.yAxis, newPos.zAxis);
            otherTransform.position = pos;
        }, null);
    }
}