Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 void Start()
 {
     flame = GetComponentInChildren<Flamable>();
     if (flame == null)
     {
         Debug.Log("WARNING! THE FLAME COMPONENT IS NULL ON " + gameObject.name);
     }
 }
Ejemplo n.º 2
0
    void OnTriggerExit(Collider collider)
    {
        GrabbableObj obj = collider.attachedRigidbody.gameObject.GetComponent<GrabbableObj>();
        if (obj == objNearHand)
            objNearHand = null;

        Flamable fmb = collider.gameObject.GetComponent<Flamable>();
        if (fmb == fireNearHand)
        {
            fireNearHand = null;
        }
    }
Ejemplo n.º 3
0
 void OnTriggerEnter(Collider collider)
 {
     //DebugConsole.dc.AddLine("OnTriggerEnterCalled");
     GrabbableObj obj = collider.attachedRigidbody.gameObject.GetComponent<GrabbableObj>();
     if (obj != null && joint == null)// && device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger))
     {
         objNearHand = obj;
         /*if (obj.shouldSnap)
         {
             obj.rb.position = attachPoint.position;
             obj.rb.rotation = attachPoint.rotation;
         }
         //DebugConsole.dc.AddLine("Should have grabbed");
         joint = gameObject.AddComponent<FixedJoint>();
         joint.connectedBody = obj.rb;
         obj.OnGrab();*/
     }
     Flamable fmb = collider.gameObject.GetComponent<Flamable>();
     if (fmb != null)
     {
         fireNearHand = fmb;
     }
 }