Пример #1
0
        public static object Invoke(Iobject a)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201408/20140813

            //- javac
            //"C:\Program Files (x86)\Java\jdk1.7.0_45\bin\javac.exe" -classpath "Y:\staging\web\java";release -d release java\TestJVMCLRRoslynIf\Program.java
            //java\TestJVMCLRRoslynIf\Program.java:41: error: bad operand types for binary operator '>'
            //        if (!(iobject0 > null))
            //                       ^
            //  first type:  Program_Iobject
            //  second type: <null>

            var e = a;

            if (e != null)
            {
                return(null);
            }

            if (e == null)
            {
                return(null);
            }

            return(null);
        }
        private Iobject GetObject()
        {
            Iobject obj = null;

            int id = Convert.ToInt32(_data["Id"]);

            //fetching obj info based on the supplied data
            switch (_type)
            {
            case ObjectType.Armour:
                if (id == 1)
                {
                    obj = new Armour()
                    {
                        Id = 1, Name = "shield of sunlight", DefenceRating = 5, Weight = 67, Type = "shield"
                    };
                }
                break;

            case ObjectType.Weapon:
                if (id == 1)
                {
                    obj = new Weapon()
                    {
                        Id = 1, Name = "shield of sunlight", DamageRating = 5, Weight = 67, Type = "shield"
                    };
                }
                break;

            default:
                obj = null;
                break;
            }
            return(obj);
        }
Пример #3
0
	public Iobject(Iobject copy)
	{
		this.obj = copy.obj;
		this.parent = copy.parent;
		this.Immidate=copy.Immidate;
		this.InitScene = copy.InitScene;
		this.hasCreate = copy.hasCreate;
	}
Пример #4
0
    public override void OnInspectorGUI()
    {

        GlobalHelper global = (GlobalHelper)target;

        EditorGUILayout.ObjectField("脚本", global, typeof(GlobalHelper), true);

        //        global.gCamera = (GameObject)EditorGUILayout.ObjectField("公用Object ", global.gCamera, typeof(GameObject), true);
        //EditorGUIUtility.LookLikeControls(120);
        GUILayout.Space(10);

        EditorGUILayout.EnumPopup("上个场景", global.lastGameScene);
        EditorGUILayout.EnumPopup("当前场景", global.curGameScene);
        GUILayout.Space(10);
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.TextField("列表大小", GUILayout.Width(100));

        global.listsize = EditorGUILayout.IntField(global.listsize, GUILayout.Width(30));
        EditorGUILayout.EndHorizontal();

        //if(!Application.isPlaying)
        //{
        for (int i = 0; i != global.listsize; ++i)
        {
            Iobject iobj = null;
            if (global.listsize > global._InitObjList.Count)
            {
                iobj = new Iobject();
                global._InitObjList.Add(iobj);
            }
            else
            {
                iobj = global._InitObjList[i];
            }

            iobj.obj = (GameObject)EditorGUILayout.ObjectField("游戏对象" + i, iobj.obj, typeof(GameObject), true);
            iobj.parent = (Transform)EditorGUILayout.ObjectField("父节点(null则自动挂接)", iobj.parent, typeof(Transform), true);
            iobj.InitScene = (GameScene)EditorGUILayout.EnumPopup("初始化场景", iobj.InitScene);
            iobj.Immidate = EditorGUILayout.Toggle("是否立刻添加", iobj.Immidate);
            GUILayout.Space(10);

            if (global.listsize < oldsize)
            {
                for (int j = 0; j != oldsize - global.listsize; ++j)
                {
                    global._InitObjList.RemoveAt(global._InitObjList.Count - 1);
                }
            }


            oldsize = global.listsize;
        }

        if (GUI.changed)
            EditorUtility.SetDirty(target);
        serializedObject.ApplyModifiedProperties();
    }
Пример #5
0
        public static object Invoke(Iobject a)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201408/20140813

            //- javac
            //"C:\Program Files (x86)\Java\jdk1.7.0_45\bin\javac.exe" -classpath "Y:\staging\web\java";release -d release java\TestJVMCLRRoslynIf\Program.java
            //java\TestJVMCLRRoslynIf\Program.java:41: error: bad operand types for binary operator '>'
            //        if (!(iobject0 > null))
            //                       ^
            //  first type:  Program_Iobject
            //  second type: <null>

            var e = a;

            if (e != null)
                return null;

            if (e == null)
                return null;

            return null;
        }