Пример #1
0
    public void Divorce()
    {
        if (lover != null && localLoveSpot != Vector3.zero)
        {
            Destroy(GetComponent <SpringJoint>());

            lover         = null;
            localLoveSpot = Vector3.zero;
        }
    }
Пример #2
0
 void OnCollisionStay(Collision col)
 {
     if (suitor = col.gameObject.GetComponent <PenguinLove>())
     {
         potentialLoveSpot = transform.InverseTransformPoint(col.contacts[0].point);
     }
     else
     {
         suitor            = null;
         potentialLoveSpot = Vector3.zero;
     }
 }
Пример #3
0
    public void Spheniscidomagnetism()
    {
        if (suitor)
        {
            lover         = suitor;
            localLoveSpot = potentialLoveSpot;

            SpringJoint child = gameObject.AddComponent <SpringJoint>();

            child.connectedBody = lover.rb;
            child.autoConfigureConnectedAnchor = false;
            child.anchor          = Vector3.zero;
            child.connectedAnchor = Vector3.zero;
            child.spring          = 50;
            child.damper          = 50;
            child.enableCollision = true;
        }
    }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     lover         = null;
     localLoveSpot = Vector3.zero;
     rb            = GetComponent <Rigidbody>();
 }