Beispiel #1
0
        public static void UnitTest_ComponentGet()
        {
            ComponentM c = obj.GetComponent <ComponentM>();

            if (c == null)
            {
                Debug.LogError("UnitTest_ComponentGet");
            }
            Debug.Log(c);
        }
Beispiel #2
0
        public static void UnitTest_ComponentAdd()
        {
            obj = new GameObject();
            ComponentM c = obj.AddComponent <ComponentM>();

            c.action =
                () =>
            {
                GameObject o = GameObject.Find("Text");
                if (o == null)
                {
                    Debug.LogError("sorry. not found text.");
                    return;
                }
                o.GetComponent <Text>().text += "\nUnitTest_ComponentAdd";
            };
        }