Example #1
0
 /// <summary>
 /// The initial setup of the Entity
 /// </summary>
 internal virtual void SetupEntity()
 {
     currentHealth      = maxHealth;
     initialTransform   = transform;
     initialState       = currentEntityState;
     rb.velocity        = Vector2.zero;
     rb.angularVelocity = 0;
     if (col != null)
     {
         col.isTrigger = false;
     }
     if (!useGravity)
     {
         gravityObj.SetGravityState(GravityState.Weightless);
     }
     rb.gravityScale = useGravity ? gravityObj.GetCurrentGravityValue() : 0;
     gravityObj.anim = anim;
     SetEntityState();
 }