Exemplo n.º 1
0
        static void Main(string[] args)
        {
            MyClass   t           = new MyClass();
            NonStatic myNonStatic = new NonStatic(t.Y);

            myNonStatic();
            myNonStatic = MyClass.X;
            myNonStatic();

            MyWrite    myDelegate = new MyWrite(WriteLine);
            MyReadLine read       = ReadLine;
            string     str        = read();

            MyWrite write = WriteLine;

            write("myDelegate == WriteLine()");
            write(str);
            write = Write;
            write("myDelegate == Write()");
            write("a");
            write("a");
            write("a");
            write("a");

            WaitKey wait = ReadKey;

            wait();
        }
Exemplo n.º 2
0
    void nonStaticCollision(Vector3 p, NonStatic ns)
    {
        Vector3 dir = p - transform.position;

        dir = new Vector3(dir.x, dir.y / 10, dir.z).normalized;
        Vector3 force = velocity * mass;

        ns.addForce(Mathf.Abs(Vector3.Dot(force, dir)) * dir);
    }
Exemplo n.º 3
0
 void Start()
 {
     nonStaticScript = GetComponentInParent <NonStatic>();
     collisionList   = new List <Collider>();
 }