示例#1
0
        public override CommandNode DeepClone(GameObject dataHolder)
        {
            CNFracture clone = CRTreeNode.CreateInstance <CNFracture>(dataHolder);

            CloneData(clone);
            return(clone);
        }
        public override CommandNode DeepClone(GameObject dataHolder)
        {
            CNJointGroups clone = CRTreeNode.CreateInstance <CNJointGroups>(dataHolder);

            clone.objectsA_  = ObjectsA.DeepClone();
            clone.objectsB_  = ObjectsB.DeepClone();
            clone.locatorsC_ = LocatorsC.DeepClone();

            clone.Name         = Name;
            clone.needsUpdate_ = needsUpdate_;

            clone.creationMode_             = creationMode_;
            clone.isRigidGlue_              = isRigidGlue_;
            clone.contactDistanceSearch_    = contactDistanceSearch_;
            clone.contactAreaMin_           = contactAreaMin_;
            clone.contactAngleMaxInDegrees_ = contactAngleMaxInDegrees_;
            clone.contactNumberMax_         = contactNumberMax_;

            clone.matchingDistanceSearch_    = matchingDistanceSearch_;
            clone.limitNumberOfActiveJoints_ = limitNumberOfActiveJoints_;
            clone.activeJointsMaxInABPair_   = activeJointsMaxInABPair_;

            clone.disableCollisionsByPairs_       = disableCollisionsByPairs_;
            clone.disableAllCollisionsOfAsWithBs_ = disableAllCollisionsOfAsWithBs_;

            clone.forcemaxMode_ = forcemaxMode_;
            clone.forceMax_     = forceMax_;
            clone.forceMaxRand_ = forceMaxRand_;
            clone.forceProfile_ = new AnimationCurve();

            int nKeys = forceProfile_.length;

            Keyframe[] arrKeys = forceProfile_.keys;

            Keyframe[] arrClonedKey = new Keyframe[nKeys];

            for (int i = 0; i < nKeys; i++)
            {
                arrClonedKey[i] = arrKeys[i];
            }
            clone.forceProfile_.keys = arrClonedKey;

            clone.enableCollisionIfBreak_    = enableCollisionIfBreak_;
            clone.breakIfForceMax_           = breakIfForceMax_;
            clone.breakAllIfLeftFewUnbroken_ = breakAllIfLeftFewUnbroken_;
            clone.unbrokenNumberForBreakAll_ = unbrokenNumberForBreakAll_;
            clone.breakIfDistExcedeed_       = breakIfDistExcedeed_;
            clone.distanceForBreak_          = distanceForBreak_;
            clone.distanceForBreakRand_      = distanceForBreakRand_;
            clone.breakIfHinge_ = breakIfHinge_;

            clone.plasticity_             = plasticity_;
            clone.distanceForPlasticity_  = distanceForPlasticity_;
            clone.plasticityRateAcquired_ = plasticityRateAcquired_;

            return(clone);
        }
示例#3
0
    //----------------------------------------------------------------------------------
    public override CommandNode DeepClone( GameObject go )
    {
      CNGroup clonedGroup = CRTreeNode.CreateInstance<CNGroup>(go);
      CloneData( clonedGroup );

      for ( int i = 0 ; i < ChildCount; ++i )
      {
        CommandNode child = (CommandNode) Children[i];
        CommandNode cloneChild = child.DeepClone( go );
        cloneChild.Parent = clonedGroup;
      }

      return clonedGroup;
    }
        public override CommandNode DeepClone(GameObject dataHolder)
        {
            CNFracture clone = CRTreeNode.CreateInstance <CNFracture>(dataHolder);

            clone.field_ = Field.DeepClone();

            clone.Name = Name;

            clone.chopMode_                  = chopMode_;
            clone.doGlobalPattern_           = doGlobalPattern_;
            clone.nDesiredPieces_            = nDesiredPieces_;
            clone.seed_                      = seed_;
            clone.chopGeometry_              = chopGeometry_;
            clone.gridResolution_            = gridResolution_;
            clone.focusMode_                 = focusMode_;
            clone.densityRate_               = densityRate_;
            clone.transitionLength_          = transitionLength_;
            clone.referenceSystem_           = referenceSystem_;
            clone.referenceSystemAxis_       = referenceSystemAxis_;
            clone.rays_number_               = rays_number_;
            clone.rays_rateRand_             = rays_number_;
            clone.rings_numberInsideAnnulus_ = rings_numberInsideAnnulus_;
            clone.rings_intRadius_           = rings_numberInsideAnnulus_;
            clone.rings_extRadius_           = rings_extRadius_;
            clone.rings_intTransitionLength_ = rings_intTransitionLength_;
            clone.rings_extTransitionLength_ = rings_extTransitionLength_;
            clone.rings_intTransitionDecay_  = rings_intTransitionDecay_;
            clone.rings_extTransitionDecay_  = rings_extTransitionDecay_;
            clone.rings_rateRand_            = rings_rateRand_;
            clone.doCentralPiece_            = doCentralPiece_;
            clone.noiseRate_                 = noiseRate_;
            clone.twistRate_                 = twistRate_;
            clone.doExtrusionEffect_         = doExtrusionEffect_;
            clone.doCoordinate_              = doCoordinate_;
            clone.arrGameObject_chopped_     = arrGameObject_chopped_;
            clone.interiorMaterial_          = interiorMaterial_;

            clone.hideParentObjectsAuto_ = hideParentObjectsAuto_;
            clone.cropGeometry_          = cropGeometry_;
            clone.cropMode_       = cropMode_;
            clone.frontierPieces_ = frontierPieces_;
            clone.weldInOnePiece_ = weldInOnePiece_;

            return(clone);
        }
示例#5
0
    //----------------------------------------------------------------------------------
    public override CommandNode DeepClone( GameObject go)
    {
      CNGroup clonedGroup = CRTreeNode.CreateInstance<CNGroup>(go);

      clonedGroup.field_ = field_.DeepClone();

      clonedGroup.Name               = Name;
      clonedGroup.IsOpen             = IsOpen;
      clonedGroup.isEffectRoot_      = isEffectRoot_;     

      for ( int i = 0 ; i < ChildCount; ++i )
      {
        CommandNode child = (CommandNode) Children[i];
        CommandNode cloneChild = child.DeepClone( go );
        cloneChild.Parent = clonedGroup;
      }

      return clonedGroup;
    }
    public void e_addEffect()
    {
      GameObject dataHolder = TargetGetDataHolder().gameObject;
      
      CREffectData e = new CREffectData();
      string name    = "Empty Effect";
      
      e.SetDefault();

      e.name_                  = name;
      e.rootNode_              = CRTreeNode.CreateInstance<CNGroup>(dataHolder);
      e.rootNode_.IsEffectRoot = true;
      e.rootNode_.Name         = "root";

      e.subeffectsNode_ = CRTreeNode.CreateInstance<CNGroup>(dataHolder, e.rootNode_);
      e.subeffectsNode_.Name = "Subeffects";
      e.subeffectsNode_.IsSubeffectsFolder = true;
      
      CNGravity gravityDaemon = CRTreeNode.CreateInstance<CNGravity>(dataHolder, e.rootNode_);
      gravityDaemon.Name = "Gravity_0";
 
      effect = e;
    }
        public override CommandNode DeepClone(GameObject dataHolder)
        {
            CNServos clone = CRTreeNode.CreateInstance <CNServos>(dataHolder);

            clone.objectsA_ = ObjectsA.DeepClone();
            clone.objectsB_ = ObjectsB.DeepClone();

            clone.Name = Name;

            clone.isLinearOrAngular_ = isLinearOrAngular_;

            clone.isPositionOrVelocity_ = isPositionOrVelocity_;
            clone.isCreateModeNearest_  = isCreateModeNearest_;
            clone.isCreateModeChain_    = isCreateModeChain_;

            clone.isFreeX_ = isFreeX_;
            clone.isFreeY_ = isFreeY_;
            clone.isFreeZ_ = isFreeZ_;

            clone.isBlockedX_ = isBlockedX_;
            clone.isBlockedY_ = isBlockedY_;
            clone.isBlockedZ_ = isBlockedZ_;

            clone.disableCollisionByPairs_ = disableCollisionByPairs_;

            clone.targetExternal_LOCAL_ = targetExternal_LOCAL_;

            clone.reactionTime_      = reactionTime_;
            clone.overreactionDelta_ = overreactionDelta_;;

            clone.speedMax_ = speedMax_;
            clone.powerMax_ = powerMax_;
            clone.forceMax_ = forceMax_;

            clone.brakePowerMax_ = brakePowerMax_;
            clone.brakeForceMax_ = brakeForceMax_;

            clone.isBreakIfDist_ = isBreakIfDist_;

            clone.isBreakIfAng_ = isBreakIfAng_;

            clone.breakDistance_       = breakDistance_;
            clone.breakAngleInDegrees_ = breakAngleInDegrees_;

            clone.dampingForce_ = dampingForce_;

            clone.distStepToDefineMultiplierDependingOnDist_ = distStepToDefineMultiplierDependingOnDist_;

            clone.functionMultiplierDependingOnDist_ = new AnimationCurve();

            int nKeys = functionMultiplierDependingOnDist_.length;

            Keyframe[] arrKeys = functionMultiplierDependingOnDist_.keys;

            Keyframe[] arrClonedKey = new Keyframe[nKeys];

            for (int i = 0; i < nKeys; i++)
            {
                arrClonedKey[i] = arrKeys[i];
            }
            clone.functionMultiplierDependingOnDist_.keys = arrClonedKey;

            clone.multiplier_ = multiplier_;
            return(clone);
        }
示例#8
0
 public override CommandNode DeepClone(GameObject dataHolder)
 {
   CNJointGroups clone = CRTreeNode.CreateInstance<CNJointGroups>(dataHolder);      
   CloneData(clone);     
   return clone;
 }