Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        Debug.LogError(int.Parse("1111111111"));
        TestHandler testHandler = new TestHandler(TestDelegate);

        testHandler.Invoke("lzd", 10);

        //事件注册委托
        TestEvent += testHandler;
        TestEvent.Invoke("lzd", 10);

        TestDelegateHandler = TestEventHandler;
        gameObject.AddComponent <MeshFilter>();
        gameObject.AddComponent <MeshRenderer>();
        Mesh mesh = GetComponent <MeshFilter>().mesh;

        mesh.Clear();

        mesh.vertices  = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 1, 0), new Vector3(1, 1, 0) };
        mesh.uv        = new Vector2[] { new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1) };
        mesh.triangles = new int[] { 0, 1, 2 };

        Vector3 vec = transform.position - enemyTransform.position;

        transform.Translate(vec);
    }
Exemplo n.º 2
0
 private void mockMethod(string parameter)
 {
     TestHandler?.Invoke(this, new EventArgs());
 }
Exemplo n.º 3
0
 private void dummyMethod()
 {
     TestHandler?.Invoke(this, new EventArgs());
 }