Exemple #1
0
 private void InitializeBaseFractal(EnemyFractalGenerator parent, GameObject _shape, Material _mat, bool _populate = false)
 {
     populate           = _populate;
     shapeObject        = _shape;
     material           = _mat;
     shapes             = parent.shapes;
     materials          = parent.materials;
     maxDepth           = parent.maxDepth;
     depth              = parent.depth + 1;
     childScale         = parent.childScale;
     transform.parent   = parent.transform;
     transform.rotation = parent.transform.rotation;
     if (populate)
     {
         Populate();
     }
 }
Exemple #2
0
 private void Initialize(EnemyFractalGenerator parent, int childIndex, GameObject _shape, Material _mat, bool _populate = false)
 {
     populate                = _populate;
     shapeObject             = _shape;
     material                = _mat;
     shapes                  = parent.shapes;
     materials               = parent.materials;
     maxDepth                = parent.maxDepth;
     depth                   = parent.depth + 1;
     childScale              = parent.childScale;
     transform.parent        = parent.transform;
     transform.localScale    = Vector3.one * childScale;
     transform.localPosition = parent.childPos[childIndex].transform;// * (0.5f + 0.5f * childScale);
     transform.rotation      = parent.transform.rotation;
     transform.localRotation = Quaternion.Euler(parent.childPos[childIndex].orientation.x, parent.childPos[childIndex].orientation.y, parent.childPos[childIndex].orientation.z);
     if (populate)
     {
         Populate();
     }
 }