Behaviour object that signals when it is destroyed.
상속: UnityEngine.MonoBehaviour
예제 #1
0
 private void ReplaceProxy()
 {
     if (destructionProxy != null) {
         destructionProxy.onDestroy -= this.OnProxyDestroyed;
     }
     GameObject obj = new GameObject("KerbCam.CameraController DestructionProxy");
     destructionProxy = obj.AddComponent<DestructionProxy>();
     destructionProxy.onDestroy += OnProxyDestroyed;
     TransformState.MoveToParent(transform, destructionProxy.transform);
 }
예제 #2
0
 private void OnProxyDestroyed(DestructionProxy p)
 {
     if (object.ReferenceEquals(p, destructionProxy)) {
         ReplaceProxy();
         // The destruction of the proxy probably indicates that the
         // relative object has been destroyed. Reparent to default.
         relativeTrn = null;
         UpdateTransformReferences();
     }
 }