Beispiel #1
0
        public override void Do()
        {
            base.Do();
            int num1 = 0;

            string[] args1  = this.args;
            int      index1 = num1;
            int      num2   = index1 + 1;
            string   index2 = args1[index1];

            string[] args2    = this.args;
            int      index3   = num2;
            int      num3     = index3 + 1;
            string   findType = args2[index3];

            string[] args3     = this.args;
            int      index4    = num3;
            int      num4      = index4 + 1;
            string   childName = args3[index4];

            string[]  args4         = this.args;
            int       index5        = num4;
            int       num5          = index5 + 1;
            string    otherRootName = args4[index5];
            Transform get           = ObjectEx.FindGet(findType, childName, otherRootName, this.scenario.commandController);

            this.scenario.commandController.Objects[index2].get_transform().SetParent(get, false);
        }
Beispiel #2
0
        public static Transform FindGet(
            string findType,
            string childName,
            string otherRootName,
            CommandController commandController)
        {
            Transform root = ObjectEx.FindRoot(findType, commandController);

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)root, (UnityEngine.Object)null))
            {
                root = GameObject.Find(otherRootName).get_transform();
            }
            if (!childName.IsNullOrEmpty())
            {
                root = ObjectEx.FindChild(root, childName);
            }
            return(root);
        }
Beispiel #3
0
        public override void Do()
        {
            base.Do();
            int num1 = 0;

            string[] args1  = this.args;
            int      index1 = num1;
            int      num2   = index1 + 1;
            int      num3   = args1[index1].Check(true, Enum.GetNames(typeof(Component.Type)));

            string[] args2    = this.args;
            int      index2   = num2;
            int      num4     = index2 + 1;
            string   typeName = args2[index2];

            string[] args3    = this.args;
            int      index3   = num4;
            int      num5     = index3 + 1;
            string   findType = args3[index3];

            string[] args4     = this.args;
            int      index4    = num5;
            int      num6      = index4 + 1;
            string   childName = args4[index4];

            string[]   args5         = this.args;
            int        index5        = num6;
            int        num7          = index5 + 1;
            string     otherRootName = args5[index5];
            GameObject gameObject    = ((Component)ObjectEx.FindGet(findType, childName, otherRootName, this.scenario.commandController)).get_gameObject();

            System.Type type = Utils.Type.Get(typeName);
            switch ((Component.Type)num3)
            {
            case Component.Type.Add:
                gameObject.AddComponent(type);
                break;

            case Component.Type.Sub:
                UnityEngine.Object.Destroy((UnityEngine.Object)gameObject.GetComponent(type));
                break;
            }
        }