public Trfm SetWorld(Transform tf) { POS = Vec3.Convert(tf.position); ROT = Vec3.Convert(tf.eulerAngles); SCA = Vec3.Convert(tf.localScale); return(this); }
public Trfm Set(Transform tf, Type type) { if (type == Type.Local) { POS = Vec3.Convert(tf.localPosition); ROT = Vec3.Convert(tf.localEulerAngles); SCA = Vec3.Convert(tf.localScale); } else { POS = Vec3.Convert(tf.position); ROT = Vec3.Convert(tf.eulerAngles); SCA = Vec3.Convert(tf.localScale); } return(this); }
private void DelayRotate(Vec3 vec, int time = 0) { var t = time != -1 ? time : mDefaultTime; var d = vec.Convert() - transform.localEulerAngles; var v = new Vector3(d.x / t, d.y / t, d.z / t); MultiTask.Push((obj) => { t--; if (t == 0) { return(MultiTask.End.TRUE); } transform.Rotate(v); return(MultiTask.End.FALSE); }); }
private void DelayMove(Vec3 vec, int time = -1) { var t = time != -1 ? time : mDefaultTime; var d = vec.Convert() - transform.localPosition; var v = new Vector3(d.x / t, d.y / t, d.z / t); MultiTask.Push((obj) => { t--; if (t == 0) { return(MultiTask.End.TRUE); } var loc = transform.localPosition; transform.localPosition = loc + v; return(MultiTask.End.FALSE); }); }