Skip to content
Snippets Groups Projects
Select Git revision
  • 379098f0e172c4aa9a373ac6e249b7e63a6aac52
  • master default
  • dependabot/nuget/source/Sample/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/MasterDevs.ChromeDevTools.Tests/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ProtocolGenerator/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ChromeDevTools/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ChromeDevTools/System.Net.Http-4.3.4
  • revert-29-revert-24-protocol_62
  • revert-24-protocol_62
  • 1.1.0
  • 1.0.2
  • 1.0.1
  • 1.0.0.40915
13 results

EnableCommandResponse.cs

Blame
  • ToolModeText.cs 1.32 KiB
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    
    public class ToolModeText : MonoBehaviour
    {
    
        // Start is called before the first frame update
        void Start()
        {
            CommunicationEvents.ToolModeChangedEvent.AddListener(OnToolModeChanged);
        }
    
        // Update is called once per frame
        void Update()
        {
    
        }
    
        void OnToolModeChanged(ToolMode ActiveToolMode) {
    
            //When ToolMode changes: Change Text of active ToolMode
            switch (ActiveToolMode) {
                case ToolMode.MarkPointMode:
                    gameObject.GetComponentInChildren<UnityEngine.UI.Text>().text = "Point Mode";
                    break;
                case ToolMode.CreateLineMode:
                    gameObject.GetComponentInChildren<UnityEngine.UI.Text>().text = "Distance Mode";
                    break;
                case ToolMode.CreateAngleMode:
                    gameObject.GetComponentInChildren<UnityEngine.UI.Text>().text = "Angle Mode";
                    break;
                case ToolMode.CreateRayMode:
                    gameObject.GetComponentInChildren<UnityEngine.UI.Text>().text = "Straight Mode";
                    break;
                case ToolMode.ExtraMode:
                    gameObject.GetComponentInChildren<UnityEngine.UI.Text>().text = "Extra Mode";
                    break;
            }
        }
    }