static operator == (x : Object, y : Object) : bool
Description
Compares if two objects refer to the same
var target :
Collider;
function OnTriggerEnter (trigger :
Collider) {
if (trigger == target)
print(
"We hit the target trigger");
}
using UnityEngine;
using System.Collections;
public class example :
MonoBehaviour {
public Collider target;
void OnTriggerEnter(
Collider trigger) {
if (trigger == target)
print(
"We hit the target trigger");
}
}
import UnityEngine
import System.Collections
class example(
MonoBehaviour):
public target as
Collider def
OnTriggerEnter(trigger as
Collider):
if trigger == target:
print('We hit the target trigger')
Get early out if there is no target.
var target :
Transform;
function Update () {
if (target == null)
return;
}
using UnityEngine;
using System.Collections;
public class example :
MonoBehaviour {
public Transform target;
void Update() {
if (target == null)
return;
}
}
import UnityEngine
import System.Collections
class example(
MonoBehaviour):
public target as
Transform def
Update():
if target == null:
return