Ejemplo n.º 1
0
        // Token: 0x06000419 RID: 1049 RVA: 0x0001483C File Offset: 0x00012A3C
        public void AddTool(global::System.Type toolType)
        {
            bool flag = toolType.IsSubclassOf(typeof(global::VRGIN.Controls.Tools.Tool)) && !global::System.Linq.Enumerable.Any <global::VRGIN.Controls.Tools.Tool>(this.Tools, (global::VRGIN.Controls.Tools.Tool tool) => toolType.IsAssignableFrom(tool.GetType()));

            if (flag)
            {
                global::VRGIN.Controls.Tools.Tool tool2 = base.gameObject.AddComponent(toolType) as global::VRGIN.Controls.Tools.Tool;
                this.Tools.Add(tool2);
                this.CreateToolCanvas(tool2);
                tool2.enabled = false;
            }
        }
Ejemplo n.º 2
0
 // Token: 0x0600042B RID: 1067 RVA: 0x00014F24 File Offset: 0x00013124
 private void CreateToolCanvas(global::VRGIN.Controls.Tools.Tool tool)
 {
     global::UnityEngine.UI.Image image = new global::UnityEngine.GameObject().AddComponent <global::UnityEngine.UI.Image>();
     image.transform.SetParent(this._Canvas.transform, false);
     global::UnityEngine.Texture2D image2 = tool.Image;
     image.sprite = global::UnityEngine.Sprite.Create(image2, new global::UnityEngine.Rect(0f, 0f, (float)image2.width, (float)image2.height), new global::UnityEngine.Vector2(0.5f, 0.5f));
     image.GetComponent <global::UnityEngine.RectTransform>().anchorMin = new global::UnityEngine.Vector2(0f, 0f);
     image.GetComponent <global::UnityEngine.RectTransform>().anchorMax = new global::UnityEngine.Vector2(1f, 1f);
     image.color = global::UnityEngine.Color.cyan;
     tool.Icon   = image.gameObject;
     tool.Icon.SetActive(false);
     tool.Icon.layer = 0;
 }