public override object WriteTo(object obj)
        {
            obj = base.WriteTo(obj);
            if (obj == null)
            {
                return(null);
            }

            ParticleSystem.CollisionModule o = (ParticleSystem.CollisionModule)obj;
            if (m_planes == null)
            {
                for (int i = 0; i < o.maxPlaneCount; ++i)
                {
                    o.SetPlane(i, null);
                }
            }
            else
            {
                for (int i = 0; i < Mathf.Min(o.maxPlaneCount, m_planes.Length); ++i)
                {
                    o.SetPlane(i, FromID <Transform>(m_planes[i]));
                }
            }

            return(obj);
        }
        public override object WriteTo(object obj, System.Collections.Generic.Dictionary <long, UnityEngine.Object> objects)
        {
            obj = base.WriteTo(obj, objects);
            if (obj == null)
            {
                return(null);
            }
            ParticleSystem.CollisionModule o = (UnityEngine.ParticleSystem.CollisionModule)obj;
            o.enabled = enabled;
            o.type    = type;
            o.mode    = mode;
#if !RT_PE_MAINTANANCE
            o.dampen       = Write(o.dampen, dampen, objects);
            o.bounce       = Write(o.bounce, bounce, objects);
            o.lifetimeLoss = Write(o.lifetimeLoss, lifetimeLoss, objects);
#endif

            o.dampenMultiplier         = dampenMultiplier;
            o.bounceMultiplier         = bounceMultiplier;
            o.lifetimeLossMultiplier   = lifetimeLossMultiplier;
            o.minKillSpeed             = minKillSpeed;
            o.maxKillSpeed             = maxKillSpeed;
            o.collidesWith             = collidesWith;
            o.enableDynamicColliders   = enableDynamicColliders;
            o.enableInteriorCollisions = enableInteriorCollisions;
            o.maxCollisionShapes       = maxCollisionShapes;
            o.quality               = quality;
            o.voxelSize             = voxelSize;
            o.radiusScale           = radiusScale;
            o.sendCollisionMessages = sendCollisionMessages;

            if (planes == null)
            {
                for (int i = 0; i < o.maxPlaneCount; ++i)
                {
                    o.SetPlane(i, null);
                }
            }
            else
            {
                for (int i = 0; i < UnityEngine.Mathf.Min(o.maxPlaneCount, planes.Length); ++i)
                {
                    o.SetPlane(i, (UnityEngine.Transform)objects.Get(planes[i]));
                }
            }

            return(o);
        }
Esempio n. 3
0
    private void OnTriggerEnter(Collider other)
    {
        Debug.Log(other.gameObject.name);

        if (other.gameObject.name == "Sphere")
        {
            ParticleSystem.CollisionModule pCollision = sanitizerParticles.collision;
            newCCube = Instantiate(colliderCube);
            newCCube.GetComponent <FollowParentObject>().myParent = other.transform;
            pCollision.SetPlane(0, newCCube.transform);
        }

//----- Checks which hand is in collision zone -----
        if (other.transform.parent.transform.parent.name == "RightController")
        {
            activeHand = "Right";
            Dispense();
            Debug.Log("Right");
        }

        else if (other.transform.parent.transform.parent.name == "LeftController")
        {
            activeHand = "Left";
            Dispense();
            Debug.Log("Left");
        }
    }