예제 #1
0
 public void SafelyDestroy(DoubleObject g)
 {
     if (transformableObjects.Contains(g.gameObject))
     {
         transformableObjects.Remove(g.gameObject);
         transformableObjects.Remove(g.brotherObject);
     }
     Destroy(g.transform.parent.gameObject);
 }
    public void GrabObject(GameObject g)
    {
        GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
        grabbedObject = g;
        DoubleObject grabbedDoubleObject = g.GetComponent <DoubleObject>();

        grabOffset = g.transform.position - gameObject.transform.position;

        brotherScript.grabbedObject = grabbedDoubleObject.brotherObject;
        brotherScript.grabOffset    = grabbedDoubleObject.brotherObject.transform.position - brotherObject.transform.position;
    }
예제 #3
0
        public void TestDoubleObjectSerialization()
        {
            PrimitiveTestPatternBuffer patternBuffer = new PrimitiveTestPatternBuffer();
            DoubleObject o1 = new DoubleObject(1.2929348);

            byte[] bytes = patternBuffer.Energize(o1);
            Assert.AreEqual(9, bytes.Length);
            object o = patternBuffer.Energize(bytes);

            Assert.IsTrue(o is DoubleObject);
            Assert.AreEqual(o1.DoubleValue, ((DoubleObject)o).DoubleValue);
            Assert.IsFalse(o1 == o);
        }
예제 #4
0
 bool NotDAWN(DoubleObject d)
 {
     return(d.worldAssignation != world.DAWN);
 }