Example #1
0
    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;
        }
    }
Example #2
0
        //For prebaking markers into the scene
        public void PrebakePlacement()
        {
            savedPosition = transform.localPosition;
            savedRotation = transform.localEulerAngles;

            currentState = AnchorState.Placed;
            UpdateState();
        }
Example #3
0
        public void AdjustPlacement()
        {
            //this will want some clever stuff for moving the model

            //update according to change
            currentState = AnchorState.Adjusting;
            UpdateState();
        }
Example #4
0
        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();
        }
Example #5
0
        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);
        }
Example #6
0
 public AnchorControl(GameObject go, AnchorState state)
 {
     this.go    = go;
     this.state = state;
 }
Example #7
0
 //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);
 }
Example #8
0
 public void UnPlace()
 {
     //update according to change
     currentState = AnchorState.Available;
     UpdateState();
 }