public void AssembleUnit(UnitAsset asset, bool gotoIdling, bool gotoAlive) { //has been spawned by asset if (!asset) { Debug.Log("no asset supplied to builder"); } m_state = UnitStateType.none; m_asset = asset; m_isPlayer = m_asset.IsPlayer(); m_faction = m_asset.Faction(); GetComponents(); AssembleSubComponents(); SetNewUnitState(UnitStateType.assembled); if (gotoIdling || gotoAlive) { SetNewUnitState(UnitStateType.idling); } if (gotoAlive) { SetNewUnitState(UnitStateType.alive); } }
public void AssembleCollisions(UnitStateType state, UnitAsset asset, UnitBuilder builder, Rigidbody rb, BoxCollider collider) { m_asset = asset; m_state = state; m_builder = builder; m_rb = rb; m_collider = collider; }
public void AssembleBrain(UnitStateType state, UnitMotor motor, UnitAsset asset) { m_state = state; m_motor = motor; m_asset = asset; m_isPlayer = m_asset.IsPlayer(); m_terrainVars = m_asset.TerrainVars(); m_targetIndicator = m_asset.TargetIndicator(); m_currentTurn = 0f; }
public void AssembleMotor(UnitStateType state, UnitAsset asset, Rigidbody rb, UnitAnimation animation) { m_state = state; m_asset = asset; m_speed = m_asset.Speed(); m_rotSpeed = m_asset.RotSpeed(); m_altitude = m_asset.Altitude(); m_rb = rb; m_animation = animation; }
public void AssembleAnimation(UnitStateType state, UnitAsset asset) { m_asset = asset; m_state = state; m_pool = m_asset.ObjectPoolAsset(); m_deathFX = m_asset.DeathFX(); m_collisionFX = m_asset.CollisionFX(); m_camShakeEvent = m_asset.CamShakeEvent(); m_motorSFX = m_asset.MotorSFX(); m_mesh = m_asset.AddMeshToUnit(transform); }
public void AssembleHealth(UnitStateType state, UnitAsset asset, UnitBuilder builder, UnitAnimation animation) { m_asset = asset; m_state = state; m_builder = builder; m_animation = animation; m_isPlayer = m_asset.IsPlayer(); m_pool = m_asset.ObjectPoolAsset(); m_faction = m_asset.Faction(); m_playerHealthChangeEvent = m_asset.UnitHealthChangeEvent(); m_playerDeathEvent = m_asset.UnitDeathEvent(); }