public void SetAnchorState(AnchorState state) { anchorState = state; switch (state) { case AnchorState.None: if (blocked) { mat.color = Color.red; } else { mat.color = Color.white; } break; case AnchorState.Active: mat.color = Color.green; blocked = true; break; case AnchorState.Debug: mat.color = Color.blue; break; default: break; } }
//For prebaking markers into the scene public void PrebakePlacement() { savedPosition = transform.localPosition; savedRotation = transform.localEulerAngles; currentState = AnchorState.Placed; UpdateState(); }
public void AdjustPlacement() { //this will want some clever stuff for moving the model //update according to change currentState = AnchorState.Adjusting; UpdateState(); }
public void Place() { TimePlaced = DateTime.Now; //Save current position of anchor to be a source later AnchorPosition = transform.localPosition; AnchorRotation = transform.localRotation.eulerAngles; //update according to change currentState = AnchorState.Placed; UpdateState(); }
public Task InitializeNodeAsync() { AnchorState anchorState = _anchorStateOptions.CurrentValue; if (anchorState.Source == AnchorStateSource.Eth1Genesis) { // Do nothing -- anchor state is provided by the Eth1 bridge } else { throw new Exception($"Unknown anchor state source: '{anchorState.Source}'"); } return(Task.CompletedTask); }
public AnchorControl(GameObject go, AnchorState state) { this.go = go; this.state = state; }
//load anchordata from a previous session public void LoadAnchor(AnchorData datum) { currentState = datum.anchorState; savedPosition = new Vector3(datum.anchorPositionX, datum.anchorPositionY, datum.anchorPositionZ); AnchorRotation = new Vector3(datum.anchorRotationX, datum.anchorRotationY, datum.anchorRotationZ); }
public void UnPlace() { //update according to change currentState = AnchorState.Available; UpdateState(); }