Skip to content
Snippets Groups Projects
Select Git revision
  • 668ccf4c57658ad0b744f1b0ccb85cf7e5ac8dad
  • master default
  • JS-based-scroll-rendering
  • Paul_Marius_Level
  • Paul_Marius_2
  • Paul_Marius
  • Andi_Mark
  • be-UnityWebView
  • gitignoreFrameitServer
  • ZimmerBSc
  • Bugfix_StageLoading
  • stages
  • MAZIFAU_Experimental
  • tsc/coneworld
  • tsc/fact-interaction
  • marcel
  • MaZiFAU_TopSort
  • mergeHelper
  • zwischenSpeichern
  • tempAndrToMaster
  • SebBranch
  • 3.0
  • v2.1
  • v2.0
  • v1.0
25 results

ToolModeText.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;
            }
        }
    }