Ejemplo n.º 1
0
     static void DoRecord()
     {
 		if(Selection.activeTransform.GetComponent<SphereCollider>()!=null)
 		{
 			colliderType = COLLIDER_TYPE.Sphere;
 			sphereCenter = Selection.activeTransform.GetComponent<SphereCollider>().center;
 			sphereRadius = Selection.activeTransform.GetComponent<SphereCollider>().radius;
 		}
  
 		if(Selection.activeTransform.GetComponent<CapsuleCollider>()!=null)
 		{
 			colliderType = COLLIDER_TYPE.Capsule;
 			capsuleCenter = Selection.activeTransform.GetComponent<CapsuleCollider>().center;
 			capsuleRadius = Selection.activeTransform.GetComponent<CapsuleCollider>().radius;
 			capsuleHeight = Selection.activeTransform.GetComponent<CapsuleCollider>().height;
 			capsuleDirection = Selection.activeTransform.GetComponent<CapsuleCollider>().direction;
 		}
  
 		if(Selection.activeTransform.GetComponent<BoxCollider>()!=null)
 		{
 			colliderType = COLLIDER_TYPE.Box;
 			boxCenter = Selection.activeTransform.GetComponent<BoxCollider>().center;
 			boxSize = Selection.activeTransform.GetComponent<BoxCollider>().size;
 		}
  
        myName = Selection.activeTransform.name;       
  
         EditorUtility.DisplayDialog("Collider Copy", "Local settings of " + myName + " collider copied", "OK", "");
     }
Ejemplo n.º 2
0
 protected virtual void FirstInit()
 {
     _fastCommand = new FCCommand();
     _fastCommand.Set(FCCommand.CMD.STOP, null, FCCommand.STATE.RIGHTNOW, true);
     _thisObject   = gameObject;
     _selfCollider = _thisObject.collider;
     if (_selfCollider.GetType().ToString().Contains("Sphere"))
     {
         _colliderType = COLLIDER_TYPE.Sphere;
     }
     else if (_selfCollider.GetType().ToString().Contains("Capsule"))
     {
         _colliderType = COLLIDER_TYPE.Capsule;
     }
     if (_parent != null && _parent.ObjectID.ObjectType == FC_OBJECT_TYPE.OBJ_BULLET)
     {
         ((FCBullet)_parent)._damageReceiver = this;
         DeActiveLogic();
     }
 }