Example #1
0
 // INITIALIZER ----------------------------------------------------------
 public void InitializePositioning(float _radius, ref GameObject _attractor, float _maxScale, bool _pivotIsBase = false, bool _isSprite = false)
 {
     // World attractor
     attractor = _attractor.GetComponent <WorldGravAttraction>();
     // Is pivot located at base
     pivotIsBase = _pivotIsBase;
     // Bounds of creature
     if (_isSprite)
     {
         isSprite = _isSprite;
         bounds   = GetComponent <SpriteRenderer>().bounds.size;
     }
     else
     {
         bounds = GetComponent <Renderer>().bounds.size;
     }
     // Transform
     creatureTransform = transform;
     // World radius + bounds of creature
     WorldRadius = _radius;
     // World Ocupation
     WorldOccupationAngle(_maxScale);
 }