public void DirectionChanged() { direction = BDirection.Direction; GenTrack.CPChanged(ElementsIndex, IntCpRole.DIRECTION, Vector3.zero, 0f, 0f, direction); B1Next.ParentDirChanged(); B2Prev.ParentDirChanged(); }
// Update is called once per frame void Update() { if (oldPosition != transform.position) { if (Moveable) { //transform.position = new Vector3(transform.position.x, GenTrack.Copy.GetTensorHeight(transform.position), transform.position.z); GenTrack.CPChanged(ElementsIndex, CpRole, transform.position, 0f, 0f, 0f); oldPosition = transform.position; B1Next.ParentPosChanged(); B2Prev.ParentPosChanged(); BDirection.ParentPosChanged(); } else { transform.position = oldPosition; } } }