Skip to content
Snippets Groups Projects
Select Git revision
  • 1e5477a47621990db16bea08be9dd0d9c72dfd2a
  • 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

DispatchMouseEventCommand.cs

Blame
  • GameObjectExtensions.cs 956 B
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public static class GameObjectExtensions
    {
        public static void UpdateTagActive(this GameObject root, string tag, bool enable)
        {
            for (int i = 0; i < root.transform.childCount; i++)
            {
                GameObject child = root.transform.GetChild(i).gameObject;
                if (child.tag == tag)
                    child.SetActive(enable);
                else
                    UpdateTagActive(child, tag, enable);
            }
        }
    
        public static void DestroyAllChildren(this GameObject root)
        {
            for (int i = 0; i < root.transform.childCount; i++)
                GameObject.Destroy(root.transform.GetChild(i).gameObject);
        }
    
        public static GameObject GetNthChild(this GameObject root, List<int> pos)
        {
            GameObject ret = root;
            foreach (var i in pos)
                ret = ret.transform.GetChild(i).gameObject;
    
            return ret;
        }
    }